RE: Sorting Problem
Posted in 2006
Make value of 'id' of same length by padding Zeros ... E.g. E9333 converts to E09333 to make equal in length with E10660. THANKS Sm/.. -----Original Message----- From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of Obnoxio The Clown Sent: Tuesday, August 01, 2006 11:47 AM To: ggk517@gmail.com Cc: informix-list@iiug.org Subject: Re: Sorting Problem ggk517@gmail.com said: > Hi all, > > I have a sorting problem. Pls see below sql: > > SQL: select id from ptable order by id desc > > Result: > > id > ------ > E9333 > E9266 > E9258 > E10691 > E10660 > > Actually, I would like my result to be sorted like that: > > id > ------ > E10691 > E10660 > E9333 > E9266 > E9258 > > Which sql query should I use? > Thanks for your help. Interesting data. If you could lose the char in front, you could say Select id[2, N] + 0 id from table order by 1 desc But if the char in front varies or is important, then it's beyond me at half past seven in the morning. -- Bye now, Obnoxio "... no bill is required as no value was provided." -- Christine Normile _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list