Home     SQL Basic     Contact Us     Site Map    

SQL BASIC

SQL SELECT

SQL WHERE

SQL DISTINCT

SQL AND

SQL OR

SQL NOT

SQL ORDER BY

SQL IN

SQL BETWEEN

SQL LIKE

SQL ALIAS

SQL AGGREGATE

>SQL COUNT

>SQL SUM

>SQL MAX

>SQL MIN

>SQL AVG

SQL GROUP BY

SQL HAVING

SQL INSERT

SQL UPDATE

SQL DELETE

SQL SELECT INTO

SQL CREATE DATABASE

SQL CREATE TABLE

SQL DROP TABLE

SQL DROP DATABASE

SQL CREATE INDEX

SQL PRIMARY KEY

SQL FOREIGN KEY

SQL ALTER TABLE

SQL TRUNCATE TABLE

SQL JOIN

SQL INNER JOIN

SQL OUTER JOIN

SQL CROSS JOIN

SQL UNION

SQL UNION ALL

SQL INTERSECT



SQL NOT

In this section, we will see on the NOT operator function for.
The NOT Operator is used to reserve the Boolean value of particular expression.

The NOT operator is ordinarily used to exclude the data with certain conditon from the results display.

The SQL syntax for the NOT operator is:

SELECT [COLUMN NAME] FROM [TABLE NAME]
WHERE NOT [CONDITION]

In detailed syntax, the SQL syntax can be like this

SELECT [COLUMN NAME] FROM [TABLE NAME]
WHERE NOT [COLUMN] = [VALUE]


EXAMPLE :

We would like to exclude IT department from the data displaying.

Table GameScores

PlayerNameDepartmentScores
JasonIT3000
IreneIT1500
JaneMarketing1000
DavidMarketing2500
PaulHR2000
JamesHR2000

SQL statement :

SELECT * FROM GameScores
WHERE
NOT Department = 'IT'

Result:

PlayerNameDepartmentScores
JaneMarketing1000
DavidMarketing2500
PaulHR2000
JamesHR2000