MySQL Forums
Forum List  »  Newbie

"Order By" on a text field
Posted by: yann.luppo
Date: May 18, 2005 01:54PM

Hi everyone,

I have a table with a primary key field (idField) declared as varchar(64). I did so because most of the time the key stored is going to be a numeric but sometimes it can be a some kind of small Text.
But now I'm facing some issues trying to order by "idField" asc.

I would like the resultset to appear like this :

1
2
3
10256
14597
24573
32564

With all the text values on one end. And of course since it's sorting text it appears like that :

1
10256
14597
2
24573
3
32564

Any suggestions would be greatly appreciated.
ps. If the solution can be SQL92 or SQL99 compliant that would be nice but not mandatory.

Options: ReplyQuote


Subject
Written By
Posted
"Order By" on a text field
May 18, 2005 01:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.