View Single Post
  #1 (permalink)  
Old April 6th, 2011, 02:25 PM
RockBal RockBal is offline
Authorized User
Points: 234, Level: 4
Points: 234, Level: 4 Points: 234, Level: 4 Points: 234, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default BETWEEN operator

Dear friends,
could you please any one explain me, how the between operator working for string values. for examples

SELECT * FROM Persons
WHERE LastName
BETWEEN 'peter' AND 'sam'

the result set from the above query includes both 'peter' and 'sam'. but if i run the below query

SELECT * FROM Persons
WHERE LastName
BETWEEN 'peter' AND 'sa'

the result doesn't include sam. why its not included in the result set and how the sql server works.

Thanks,
Rockbal
Reply With Quote
The Following User Says Thank You to RockBal For This Useful Post:
Ramkumar Bishnoi (April 6th, 2011)