Click here to Skip to main content
15,914,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone.

i want to know whether can we give a range in sql.
means i want to get the values in field where one period to another period.
example:there is two fields in the table period and data. i want to get all the values in data field according to given period value (like 1 to 3)
how can i do this??

thank you in advance
Posted

select * from tbl where period >=1 and period <= 3
 
Share this answer
 
select * from atable where atable.acolumn between 1 and 3.
 
Share this answer
 
select data from tbl where period between 1 and 3
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900