Skip to content


MySQL Order By Floating , integer ,Numbers

Say we have 5 (five) records in the database table with the following
values in the “price” field/column.

  • 19.99
  • 125
  • 5.99
  • 199
  • 300


Execute this query ..

SELECT

*
FROM `table` ORDER BY `price`
ASC;

If your result looks like in following list,  you need my help :)

  • 125
  • 199
  • 19.99
  • 300
  • 5.99

Use following query if your result comes in this way..


SELECT * FROM `table` ORDER BY ABS(`price`) ASC;

Thanks and Regards
Sushant Danekar

Posted in Database.

Tagged with , , , , , .



0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.