RE:cord

[SQL] Search for Data Containing Keywords (WHERE LIKE '%A%') 본문

SQL

[SQL] Search for Data Containing Keywords (WHERE LIKE '%A%')

beie 2024. 12. 3. 14:54
SELECT *
FROM movies
WHERE title LIKE 'Christmas' OR title LIKE 'Santa';

  * 정확하게 'Christmas' or 'Santa'가 title이어야 출력.

    It would be out if the title is 'Christmas' or 'Santa'. 

 

 

SELECT *
FROM movies
WHERE title LIKE '%Christmas%' OR title LIKE '%Santa%';

  * 'Christmas' or 'Santa'가 title에 포함되어 있으면 출력.

    It would be out if the title contained 'Christmas' or 'Santa.'