#119. [LeetCode / MySQL] 1527. Patients With a Condition

문제

 

 

입력 코드

1. 

SELECT *
FROM Patients
WHERE conditions LIKE 'DIAB1%' OR conditions LIKE '% DIAB1%';

 

 

2. REGEXP

SELECT *
FROM Patients
WHERE conditions REGEXP '\\bDIAB1'

 

 

코드 설명

#SELECT #WHERE #LIKE #% #REGEXP

 

 

문제 출처

https://leetcode.com/problems/patients-with-a-condition/description/?envType=study-plan-v2&envId=top-sql-50