0% found this document useful (0 votes)
72 views1 page

'NOT' Can Be Used With Another Operator To Combine Positive and Negative Conditions

The document discusses using the 'NOT' operator in SQL queries to combine positive and negative conditions or turn a positive condition negative. It provides an example SQL query using the 'NOT' operator with 'AND' to select records where the id is 1 and the city is not Vancouver, and another example using 'NOT' alone to select all records where the city is not Vancouver.

Uploaded by

Laxman Thapa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views1 page

'NOT' Can Be Used With Another Operator To Combine Positive and Negative Conditions

The document discusses using the 'NOT' operator in SQL queries to combine positive and negative conditions or turn a positive condition negative. It provides an example SQL query using the 'NOT' operator with 'AND' to select records where the id is 1 and the city is not Vancouver, and another example using 'NOT' alone to select all records where the city is not Vancouver.

Uploaded by

Laxman Thapa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

'NOT' can be used with another operator to combine positive and negative conditions

mysql> SELECT * -> FROM employee -> WHERE ((employee.id = 1) -> AND (employee.city != 'Vancouver'));

'NOT' operator ('!') turns a positive into a negative


The following statement retrieves all records that do not contain 'Vancouver' as City.
mysql> SELECT * FROM employee WHERE (employee.city != 'Vancouver');

You might also like