ข้ามไปยังเนื้อหา
English
Matching text patterns with LIKE

= only matches text exactly. To match a pattern, use LIKE with two wildcards:

  • % stands for any run of characters (including none)
  • _ stands for exactly one character
SELECT name FROM student WHERE name LIKE 'S%';

'S%' means "starts with S". '%a%' means "contains an a". '_o%' means "an o as the second letter".

LIKE 'S%' finds Sara, LIKE 'o' finds Tom, IN ('Mei', 'Tom') finds both, BETWEEN 72 AND 88 includes both ends

เอกสารประกอบการเรียน

เข้าสู่ระบบหรือสร้างบัญชี

IGCSE, A-Level & AP