Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
could u please suggest me any other solution for

Should sort by
1.aaaa
5.xx
11.bbbbbb
12
15. how can i get this sorting order

Wrong
1.aaaa
11.bbbbbb
12
15.
5.xx
Posted
Comments
[no name] 6-Dec-13 6:30am    
Can you provide your table structure also or else atleast mention column name
[no name] 6-Dec-13 6:32am    
use Order by your numeric column mentioned this example.
patil.nitin8358 6-Dec-13 6:38am    
Hello Snehasish_Nandy ,

actually column is varchar ,could u please see the updated question


Should sort by
1.aaaa
5.xx
11.bbbbbb
12
15. how can i get this sorting order

Wrong
1.aaaa
11.bbbbbb
12
15.
5.xx


Many Many thank for looking this issue
Sebastian T Xavier 6-Dec-13 6:49am    
http://www.codeproject.com/Questions/693132/sorting-an-number-in-sql

why repost?

1 solution

SQL
SELECT * FROM MyTable
ORDER BY CAST(amount AS Numeric(10,0)) DESC
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900