Skip to content

LIKE, IN and BETWEEN

Handout

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".

Handout

Log in or create account

IGCSE & A-Level