MAKE FULL WEB APPLICATION WITH JUST SQL KNOWLEDGE? CLICK HERE
The BETWEEN condition allows you to get back values within
a range. The BETWEEN operator selects a range of data between
two values. These values can be numbers, text, or dates. The BETWEEN
function can be used in any valid SQL statement - select,
insert, update, or delete.
The syntax for the BETWEEN condition is:
SELECT columns FROM tables WHERE column1
between value1 and value2; |
EXAMPLE #1 :-
NAME OF SUPPLIER |
SUPPLIER ID |
Samudri Store |
5000 |
Krishna Store |
5006 |
Newland Store |
5020 |
The following is an SQL statement that uses the BETWEEN function:
SELECT *FROM suppliers WHERE supplier_id
between 5000 AND 5010; |
This would return all rows where the supplier _id is between 5000
and 5010, inclusive. It is equivalent to the following SQL statement:-
RESULT:-
NAME OF SUPPLIER |
SUPPLIER ID |
Krishna Store |
5006
|
If you don't find what you are looking for. Please click
here to submit your query, our experts will reply soon.
|