Re: How ">=" Work on Varchar field?
From: Prabhat (not_a_mail_at_hotmail.com)
Date: 11/02/04
- Next message: Alejandro Mesa: "RE: SP WITH RECOMPILE option"
- Previous message: Aaron [SQL Server MVP]: "Re: is this bad?"
- In reply to: Tom Moreau: "Re: How ">=" Work on Varchar field?"
- Next in thread: Tom Moreau: "Re: How ">=" Work on Varchar field?"
- Reply: Tom Moreau: "Re: How ">=" Work on Varchar field?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 22:29:59 +0530
Hi Tom,
Because my original Query was bit slow when used with order by. So I am
using that with Index hint, Now that is very fast.
Thanks
Prabhat
"Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message
news:#iStL0PwEHA.4048@TK2MSFTNGP15.phx.gbl...
> ORDER BY is used for sorting. Why don't you want to use it? Index hints
> are used only when your particular query is not performing properly and
this
> method is used only in exceptional cases. Using index hints for sorting
is
> like using a wrench to put out a fire.
>
> --
> Tom
>
> ---------------------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
>
> "Prabhat" <not_a_mail@hotmail.com> wrote in message
> news:%23flHHwPwEHA.2016@TK2MSFTNGP15.phx.gbl...
> Hi Tom,
>
> I don't want to use the Order by, SO I have used the Index Hint there in
the
> query.
> Thanks
> Prabhat
>
> "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message
> news:u3mXVqPwEHA.3288@TK2MSFTNGP14.phx.gbl...
> > The where clause has absolutely nothing to do with sorting. Check out
> ORDER
> > BY in the BOL.
> >
> > --
> > Tom
> >
> > ---------------------------------------------------------------
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Columnist, SQL Server Professional
> > Toronto, ON Canada
> > www.pinnaclepublishing.com
> >
> >
> > "Prabhat" <not_a_mail@hotmail.com> wrote in message
> > news:uYrcXoPwEHA.1976@TK2MSFTNGP09.phx.gbl...
> > Hi All,
> >
> > Thanks for the discussion.
> >
> > Now I am clear that That is not the Sum(Ascii) but There is some thing
> that
> > uses the Ascii for all Characters in the Word to Compare. I have to know
> > that.
> >
> > Below is my Situation:-
> >
> > Table1
> > =====
> > DonorID Int (Identity) - Set to "Primary key"
> > LastName varchar(25)
> > FirstName varchar(25)
> > ...
> > ...
> > ...
> > There is a Compoud Index IND_DONOR_NAME - on LastNAme, FirstName.
(Because
> I
> > Want the output order by Lastname, FirstName
> >
> > When I Issue the SQL:-
> >
> > select donorid, firstname, lastname, state, zip, phonenum, country,
> > olddonorid, sourceid
> > from donor (index = ind_donor_name)
> > where lastname >= 'nath' and sourceid = 'flcc'
> >
> > I do get the Result, But the result is not Properly Ordered.
> >
> > Means: I have "nath" as Last Name in 7 rows (Which Includes all the rows
> > that returns). While I get 2 Rows as my 1st 2 rows of result set and
rest
> 5
> > rows I get at End of the result set (After Z). I Also Reindexed the
Table.
> > Still Did not help.
> >
> > If I Use Like 'nath%' instead of >= 'nath' I get the correct Order -
> Proper
> > use of the Index. So I am Confused and wanted to know what is that
causing
> > the >= to not order propwerly?
> >
> > Thanks
> > Prabhat
> >
> > "Prabhat" <not_a_mail@hotmail.com> wrote in message
> > news:#wLgPgOwEHA.3012@TK2MSFTNGP10.phx.gbl...
> > > Hi All,
> > >
> > > Suppose I will use
> > > Where col1 >= 'value1'
> > >
> > > and the col1 is a varchar - Indexed column, then how does the >= works
> on
> > > that Case?
> > >
> > > Does that take the sum of the ascii value of all characters of value1
> and
> > > find all rows with > value then the sum and display, or how?
> > >
> > > Thanks
> > > Prabhat
> > >
> > >
> >
> >
>
>
- Next message: Alejandro Mesa: "RE: SP WITH RECOMPILE option"
- Previous message: Aaron [SQL Server MVP]: "Re: is this bad?"
- In reply to: Tom Moreau: "Re: How ">=" Work on Varchar field?"
- Next in thread: Tom Moreau: "Re: How ">=" Work on Varchar field?"
- Reply: Tom Moreau: "Re: How ">=" Work on Varchar field?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|