문제
Write a solution to find the patient_id, patient_name, and conditions of the patients who have Type I Diabetes. Type I Diabetes always starts with DIAB1 prefix.
Return the result table in any order.
The result format is in the following example.
1-1 문제풀이
SELECT *
FROM Patients
WHERE conditions REGEXP '\\bDIAB1'
1-2 문제 풀이
SELECT patient_id, patient_name, conditions
FROM Patients
WHERE conditions LIKE 'DIAB1%'
AND coditions LIKE '% DIAB1%'
오답이유
1. 'SADIAB100'의 경우를 어떻게 처리 해야 할지 생각을 못함.
2. 정규 표현식에서 \b의기능이 무엇인지 알지 못했음.
\b : 단어구분자.
'취준 > 코팅 테스트' 카테고리의 다른 글
[LeetCode] - 1251. Average Selling Price (1) | 2024.03.28 |
---|---|
[LeetCode] - 180. Consecutive Numbers (0) | 2024.03.27 |
[LeetCode] - 586. Customer Placing the Largest Number of Orders (0) | 2024.03.25 |
[LeetCode] - 577.Employee Bonus (0) | 2024.03.18 |
[LeetCode] - 176.Second Higest Salary (0) | 2024.03.13 |