View Full Version : SQL ORDER BY problem
Bluemonkey
04-11-2003, 04:06 PM
how can i Order by on a letter that i choose and not from a??
so i can start it on "q" and it will run all the way through "q r s t u ...." and start anagin "v w x y z ... a b c d "
thank you very mcuh for the help
Roy Sinclair
04-11-2003, 04:14 PM
It depends on the database you're using. If the database doesn't support a custom collation order then you're pretty much out of luck. If it does support a custom collation then how to do it will be documented by the vendor, remember that the key words to search for are "collate" or "collation".
Bluemonkey
04-11-2003, 04:17 PM
i am using windows microsoft sql server 7
Roy Sinclair
04-11-2003, 04:40 PM
As far as I can tell then you're out of luck for a simple solution. You'll have to manipulate the string such as by altering the values using a substitution table or something like that to get a string you can order by.
Hmm. As far as my limitted knowledge on almost anything goes (i'm "an obnoxious idiot who doesn't know his you know what from a hole in the ground" <-- i don't even seem to be able to put this as my sign, damn!)), you cant do that on SQL Server.
I don't know your app, but id suggest putting a character in front of it when you insert the values. Shouldnt be that hard (6 lines of code i think). Than you can strip this letter of (1 line of code) after you retrieved the values.
Need the code ?
Bluemonkey
04-11-2003, 10:32 PM
dont worry about the code thanks.
cheers for the help
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.