SQL NOT BETWEEN OPERATOR




The NOT BETWEEN operator is used to select values outside a range.
The NOT BETWEEN operator selects values outside a range. The values can be numbers, text, or dates.

SYNTAX:

SELECT column1, column2....columnN
FROM   table_name
WHERE  column_name NOT BETWEEN val-1 AND val-2;

EXAMPLE:

SELECT * FROM student
WHERE mark1 NOT BETWEEN 30 AND 40;

Displays all the columns from the table student with mark1 NOT between 30 and 40.


SELECT * FROM Products
WHERE ProductName NOT BETWEEN 'C' AND 'M';

Displays all the products which is not having c to m as product name.

No comments:

Post a Comment