SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
- The following SQL statement selects all wikitechytable with a fees between 20 and 40:
SELECT * FROM wikitechytable where fees BETWEEN 20 AND 40
- To display the wikitechytable outside the range of the previous example, use NOT BETWEEN:
select * from wikitechytable where fees NOT BETWEEN 20 AND 40
BETWEEN Text Values Example
- The following SQL statement selects all products with a wikitechytable between Praveen and Venkat:
select * from wikitechytable where name BETWEEN 'Praveen' AND 'Venkat'
NOT BETWEEN Text Values Example
- The following SQL statement selects all products with a wikitechytable not between Praveen and Venkat:
select * from wikitechytable where name NOT BETWEEN 'Praveen' AND 'Venkat'
- The following SQL statement selects all orders with an OrderDate between '2002-01-01' and '2009-01-01':
select * from wikitechytable where dob BETWEEN '2002-01-01' AND '2009-01-01'
NOT BETWEEN Dates Example
- The following SQL statement selects all orders with an OrderDate not between '2002-01-01' and '2009-01-01':
select * from wikitechytable where dob NOT BETWEEN '2002-01-01' AND '2009-01-01'