stebut05 Posted April 18, 2006 Share Posted April 18, 2006 Hi all,Thanks for taking a look at this thread. I have a database query that retuens the results correctly, but i need to do an order by clause. When i do this it displays numbers before letters, whereas i need to display letters then number e.gJobcard No Page No.PRE001 page 1PRE002 page 1POS001 page 1POS001 page 2POS002 page 1455101 page 1455101 page 2455101 page 3567070 page 1 etc, etc, etc,the field Jobcard No. is a Varchar i think i need to changed to asci and Order By that way. I'm not sure though, any ideas??? Thanks for any help, advice, thoughts in advance.Kind Regards,Steven Quote Link to comment https://forums.phpfreaks.com/topic/7720-order-by/ Share on other sites More sharing options...
wisewood Posted April 18, 2006 Share Posted April 18, 2006 ORDER BY jobcard DESC?? Or is that too easy? Quote Link to comment https://forums.phpfreaks.com/topic/7720-order-by/#findComment-28164 Share on other sites More sharing options...
stebut05 Posted April 18, 2006 Author Share Posted April 18, 2006 That will do the followingJobcard No Page No.POS001 page 1POS002 page 1POS001 page 2PRE001 page 1PRE002 page 1567070 page 1455101 page 1455101 page 2455101 page 3So the answer to your question, too easy and i wish....lolRegards,Steven Quote Link to comment https://forums.phpfreaks.com/topic/7720-order-by/#findComment-28168 Share on other sites More sharing options...
wisewood Posted April 18, 2006 Share Posted April 18, 2006 could you not have an additional field in your table named "is_numeric" or something?This way you could just run two queries...select * from your_table where is_numeric=0//show the resultsthenselect * from your_table where is_numeric=1You could have a script running on the variable before its inserted into the database to decide whether it contains any non numeric characters or not. Quote Link to comment https://forums.phpfreaks.com/topic/7720-order-by/#findComment-28191 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.