Gossamer Forum
Home : General : Databases and SQL :

sql sort order

Quote Reply
sql sort order
hi, I have a problem with the sort order in SQL, I have record displaying like

code description
A13A xxxxxxx
A14A xxxxxxx
AAAA xxxxxxx

I want the records sorted by code but in epsidec format, like characters will come first before numbers. I've been reading about collation but really cant figure it out. Can someone help me on how to do this? PLs.
Quote Reply
Re: [vines] sql sort order In reply to
What SQL is it? MySQL ... MS SQL ... PostGres ... ?

Code:
SELECT * FROM TableName ORDER BY code DESC;

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [vines] sql sort order In reply to
What you would need to change locales at sorting phase.
SQL doesn't support changing locales directly.
You should sort them in Perl, using correct locale table.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...