SQL - BETWEEN Operator with IN Example
The following SQL statement selects all products with a price BETWEEN 10 and 20, but products with a CategoryID of 1,2, or 3 should not be displayed:
Example
SELECT * FROM Products
WHERE (Price BETWEEN 10 AND 20)
AND NOT CategoryID IN (1,2,3);
Try it Yourself »
SQL - NOT BETWEEN Operator Example
To display the products outside the range of the previous example, use NOT BETWEEN:
Subscribe to:
Posts (Atom)