xxxxxxxxxx
SELECT * FROM Customers
WHERE Country NOT IN ('Germany', 'France', 'UK');
xxxxxxxxxx
SELECT first_name, country
FROM Customers
WHERE country NOT IN ('UK', 'UAE');
xxxxxxxxxx
(NOT) operator excluding given
For example:
Select last_name, job_id From Employees
Where "Not" job_id = 'ABC';
xxxxxxxxxx
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';
xxxxxxxxxx
-- You can use LEFT JOIN / NULL
SELECT *
FROM common
LEFT JOIN table1 t1
ON t1.common_id = common.common_id
WHERE t1.common_id IS NULL
xxxxxxxxxx
(NOT) operator excluding given
For example:
Select last_name, job_id From Employees
Where "Not" job_id = 'ABC';