Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
| Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 6th, 2011, 02:25 PM
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
The Following User Says Thank You to RockBal For This Useful Post:
Ramkumar Bishnoi (April 6th, 2011)
  #2 (permalink)  
Old April 7th, 2011, 12:55 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following thread which might help you:
SQL 'Between' operator
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use like operator thillaiarasu SQL Server 2000 4 April 23rd, 2010 09:47 AM
new line operator in c# MunishBhatia C# 2005 9 December 11th, 2007 03:03 AM
=== operator in c# surendraparashar C# 2005 8 November 8th, 2007 05:14 AM
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 04:51 AM
? operator in PHP Tachyon Beginning PHP 2 May 24th, 2004 02:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.