Skip to main content
Help Google'rs to find this post easier: added `varchar` and `number` to title
Link
che
  • 12.3k
  • 7
  • 47
  • 71

How to ORDER BY "varchar"varchar field as "number" correctlynumber?

Help Google'rs to find this post easier: added `varchar` and `number` to title
Link

How to ORDER BY "varchar" field as "number" correctly?

Source Link
Mr. Smit
  • 2.6k
  • 3
  • 34
  • 47

How to ORDER BY correctly?

I have problem with sort/order by, not working like I need.

SELECT `proc` FROM `table` ORDER BY `proc` DESC; 

Result:

80.0 proc 70.0 proc 60.0 proc 50.0 proc 40.0 proc 200.0 proc 20.0 proc 190.0 proc 180.0 proc 170.0 proc 160.0 proc 150.0 proc 140.0 proc 130.0 proc 120.0 proc 110.0 proc 100.0 proc 

What I need is:

200.0 proc 190.0 proc 180.0 proc 170.0 proc 160.0 proc 150.0 proc 140.0 proc 130.0 proc 120.0 proc 110.0 proc 100.0 proc 90.0 proc 80.0 proc 70.0 proc 60.0 proc 50.0 proc 40.0 proc 20.0 proc 

How to do it ?