Home » SQL Basics » Retrieving Data » Using BETWEEN

Using BETWEEN

Using BETWEEN

Syntax: SELECT “column_name1”, “column_name2″,….”column_nameZ” FROM “table_name”
WHERE “column_name” BETWEEN ‘value1’ AND ‘value2’

Example: SELECT name, age, EmployedDate FROM employee where EmployedDate between ‘Feb-12-2009’ and ‘Mar-12-20010’

In the above example it only displays all employees employed between the dates ‘Feb-12-2009’ and ‘Mar-12-20010’.

Leave a Reply

Your email address will not be published. Required fields are marked *