CAST function can be used like below:
SELECT col_name from table_name
ORDER BY CAST(col_name AS SIGNED INT);
SELECT col_name from table_name
ORDER BY CAST(col_name AS SIGNED INT);
We just make the ORDER BY clause work on a integer value.That is done by CAST(col_name AS SIGNED INT) in the statement.
No comments:
Post a Comment