Skip
Arish's avatar

50. Excluding Patterns with NOT LIKE


NOT LIKE

Excludes rows matching a pattern.

Syntax

sql
1SELECT * FROM students
2WHERE name NOT LIKE 'A%';

Returns all names NOT starting with 'A'.

Example

sql
1-- Names NOT starting with 'J'
2SELECT * FROM students
3WHERE name NOT LIKE 'J%';