What is the use of NOT LIKE function in SQL?

The NOT LIKE operator in SQL is used on a column which is of type varchar. Usually, it is used with % which is used to represent any string value, including the null character \0.

Syntax:

SELECT
column
FROM

table_name
WHERE
column
NOT
LIKE

pattern;
UPDATE

table_name
SET
column

=
value
WHERE
column
NOT
LIKE

pattern;
DELETE
FROM

table_name
WHERE
column
NOT
LIKE
pattern;

Example: Let’s say we want the list of customer names that don’t start with ‘A’. Below query will give us the required result set.

SELECT

CustomerName
FROM

Customer
WHERE

CustomerName
NOT
LIKE
'A%'
;

Output: John