How to use NOT LIKE Operator In SQL
NOT LIKE Operator is working opposite as LIKE Operator do. The NOT LIKE Operator to find information that does not match any condition. Let’s understand with examples.
Query
SELECT *
FROM Article
WHERE name NOT LIKE '[E-Z]%';
The Result Looks Like:
Explanation: This query uses the NOT LIKE operator which returns the name that does not starts with letters ranging from E to Z.
SQL Server LIKE Operator
The SQL Server LIKE operator is similar to the SQL LIKE Operator. It retrieves the rows by matching a string or character-specified pattern. A pattern can include regular characters wildcard characters or both. It is often used in the WHERE clause of the SELECT, UPDATE, and DELETE statements to filter rows based on pattern matching. It is a flexible operator that helps in finding pattern matching when you don’t know the exact pattern.
Syntax:
SELECT column1, column2
FROM table_name
WHERE col_name LIKE pattern ;
Explanation: In the above query, we have used the LIKE Operator to find the pattern in the particular column called col_name in table table_name. We will understand everything in detail in the below examples.
Contact Us