convert varchar to int in select query order by

Sql Server query varchar data sort like int

MySQL ABS() returns the absolute value of a number.

SELECT * FROM MyTable ORDER BY ABS(MyCol) DESC;

Leave a Reply