SELECT * FROM Customers
WHERE Country NOT IN ('Germany', 'France', 'UK');
SELECT * FROM Customers WHERE NOT City = 'Berlin';
(NOT) operator excluding given
For example:
Select last_name, job_id From Employees
Where "Not" job_id = 'ABC';
SELECT first_name, country
FROM Customers
WHERE country NOT IN ('UK', 'UAE');
SELECT first_name, last_name
FROM Customers
WHERE NOT country = 'USA';
Returns true if a record DOESN’T meet the condition.
Example: Returns true if the user’s first_name doesn’t end with ‘son’.
SELECT * FROM users
WHERE first_name NOT LIKE '%son';
select * from TableName(nolock) where onlineUser!=('Y')
(NOT) operator excluding given
For example:
Select last_name, job_id From Employees
Where "Not" job_id = 'ABC';