Beginner

181. NOT LIKE

Learn how NOT LIKE excludes text values that match a specified pattern.

📘 Lesson 181 of 728 ⏱ 8 min 🎯 Beginner

NOT LIKE returns rows where a text value does not match the specified pattern.

It is useful when analysts need to exclude records containing unwanted text patterns.

Find employees whose names do not start with the letter S.

SQL
SELECT
    EmployeeName
FROM Employees
WHERE EmployeeName NOT LIKE 'S%';

NOT LIKE is useful for data cleansing, exception reporting, filtering unwanted categories, and text-based validation.

  • NOT LIKE excludes matching patterns.
  • It is commonly used with text columns.
  • % represents zero or more characters.
  • _ commonly represents one character.
  • It is useful for exclusion filtering.
What does NOT LIKE do?

NOT LIKE returns rows where a text value does not match the specified pattern.

When is NOT LIKE useful?

It is useful when records matching a particular text pattern need to be excluded.

Have you finished this lesson?

Introduction to SQL – All Lessons