Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
select * from table where loc=//here i have to implement logic


in table loc column have values like locations.so i need to retrieve location between 'a' and 's'.all the location having value between a and s .
Posted
Comments
Ankur\m/ 19-Feb-13 6:54am    
You question is not very clear. What do you mean between a and s?

Here 's your required query

SQL
select * from table where locname between 'a%' and 's%'
order by locname


Enjoy & happy coding :)
 
Share this answer
 
v2
Do you want all the location that starts with a and ends with s?

If yes, here's the query.

SQL
select * from table where loc LIKE 'a%s'
 
Share this answer
 
v3
Comments
Ankur\m/ 19-Feb-13 6:53am    
Reported as 'not an answer'.
Use 'Have a Question or Comment?' widget to post question/comment to a question rather than posting an 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