Skip to content · ⁨ข้ามไปยังเนื้อหา⁩
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

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

ไทย

การจับคู่รูปแบบข้อความด้วย LIKE

= จับคู่ข้อความได้ ตรงกันเป๊ะ เท่านั้น หากต้องการจับคู่ รูปแบบ ให้ใช้ LIKE พร้อมตัวแทนสองตัว:

  • % แทนการมีตัวอักษรใดๆ (รวมถึงไม่มีเลย)
  • _ แทนตัวอักษรพอดีหนึ่งตัว
SELECT name FROM student WHERE name LIKE 'S%';

'S%' หมายถึง "เริ่มต้นด้วย S". '%a%' หมายถึง "มีตัว a". '_o%' หมายถึง "o เป็นอักษรตัวที่สอง"

Handout · ⁨เอกสารประกอบการเรียน⁩

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP