vijayfreaks Posted August 27, 2007 Share Posted August 27, 2007 Hi.. i have design number is there in mysql its varchar(Alphanumeric values) like B1122 B1119 B1117 B1116 B1115 B1111 B1105 A158 A157 B1104 B1103 how to get the natural order of this design number. i added 3 item A1,A11,A2 when i write order by class its giving like A1,A11,A2 but actuval order is A1,A2,A11 how to get that order via query in mysql? hope u understand my problem? Regards, Vijay Quote Link to comment https://forums.phpfreaks.com/topic/66855-alpha-numeric-sort-in-mysql/ Share on other sites More sharing options...
Barand Posted August 27, 2007 Share Posted August 27, 2007 ...ORDER BY SUBSTRING(design_number,1,1), CONVERT(SUBSTRING(design_number,2) , UNSIGNED INTEGER) Quote Link to comment https://forums.phpfreaks.com/topic/66855-alpha-numeric-sort-in-mysql/#findComment-335139 Share on other sites More sharing options...
vijayfreaks Posted August 27, 2007 Author Share Posted August 27, 2007 Hi.. but it want be fix there would be no guessing on alpha num.. it may be any thing in combination.. then is it possible? Regards, Vijay Quote Link to comment https://forums.phpfreaks.com/topic/66855-alpha-numeric-sort-in-mysql/#findComment-335165 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.