Did you find this useful?
Socialize it today.


SQL Between Operator

Thursday, November 17, 2011

tags SQL

The BETWEEN operator is used in a WHERE clause to select a range of data between two values. The values can be numbers, text, or dates.

Syntax


SELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN value1 AND value2

Examples

Search for records with a customer ID between 50 and 100.


SELECT * FROM Customers
WHERE custID BETWEEN 50 AND 100


Search for records with a customer ID not between 50 and 100.


SELECT * FROM Customers
WHERE custID NOT BETWEEN 50 AND 100

Please help us spread the word by socializing it today!

email contact us

Did you find something wrong with the information on this page? Please take a moment to report it to us so that we can continue to improve the quality of the information on this site. Click here to report an issue with this page.



Recommended Books & Training Resources

Head First SQL: Your Brain on SQL A Learners Guide SQL Cookbook