Re: Comparision on Char Column With Alphanumeric Values
From: Dejan Sarka (dejan_please_reply_to_newsgroups.sarka_at_avtenta.si)
Date: 11/02/04
- Next message: Prabhat: "Re: Index Seek (or) Index Scan in Execution Plan"
- Previous message: Steve Kass: "Re: Index Seek (or) Index Scan in Execution Plan"
- In reply to: Vaibhav: "Re: Comparision on Char Column With Alphanumeric Values"
- Next in thread: Steve Kass: "Re: Comparision on Char Column With Alphanumeric Values"
- Reply: Steve Kass: "Re: Comparision on Char Column With Alphanumeric Values"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 15:36:18 +0100
I guess there must be some sort order where alfa characters have lower ASCII
number that numbers.
-- Dejan Sarka, SQL Server MVP Associate Mentor www.SolidQualityLearning.com "Vaibhav" <consultvaibhav@yahoo.com> wrote in message news:uqIlscOwEHA.356@TK2MSFTNGP10.phx.gbl... > Thank you for the reponse and you are right the expression would always > evaluate to false and therfore no records are returned. > > But the same type of expressions evalutes to true when executed against a > IBM-DB2 database ans returns records as required, Why is that ? > > Is there any way where the expression as mentioned by you, would evaluate to > 'True' in MS-SQL server and thus return records. > > TIA > > > "Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@avtenta.si> wrote in > message news:OxD9rjKwEHA.4004@tk2msftngp13.phx.gbl... > > Check your expression again - look at this: > > > > IF '43299AAAAAAAA' <= '4329999999999' > > PRINT 'True' > > ELSE > > PRINT 'False' > > > > -- > > Dejan Sarka, SQL Server MVP > > Associate Mentor > > www.SolidQualityLearning.com > > > > "Vaibhav" <consultvaibhav@yahoo.com> wrote in message > > news:OeV6ZIGwEHA.200@TK2MSFTNGP11.phx.gbl... > >> Hi All > >> > >> I am using SQL Server 2000. > >> > >> I have a table which a column ID(Char(13)). The column has values varying > >> from BBB, AAA, , 432990098C,432990164C, 4329999999999 and so on. When i > > try > >> to retrieve records from the > >> table using a query like > >> > >> Select * From myTable Where Id >='43299AAAAAAAA' AND Id<='4329999999999' > >> > >> The query returns 0 records, whereas ideally it should return records > >> with > >> values like '432999098C','432990164C' and so on. > >> > >> I have tried all the different collations on the table column but with no > >> success. > >> > >> Can some sql guru help me on this. > >> > >> TIA > >> > >> > > > > > >
- Next message: Prabhat: "Re: Index Seek (or) Index Scan in Execution Plan"
- Previous message: Steve Kass: "Re: Index Seek (or) Index Scan in Execution Plan"
- In reply to: Vaibhav: "Re: Comparision on Char Column With Alphanumeric Values"
- Next in thread: Steve Kass: "Re: Comparision on Char Column With Alphanumeric Values"
- Reply: Steve Kass: "Re: Comparision on Char Column With Alphanumeric Values"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|