字符串+0
例:select * from a order by (column+0) desc
CAST(column as type)
CONVERT(column, type)
例:select * from a order by CONVERT(column,SIGNED) desc
select * from a order by CAST(column as SIGNED) desc
SELECT CONVERT(filedName, UNSIGNED INTEGER)
DATE日期类型
DATETIME日期时间类型
TIME时间类型
CHAR 字符类型
SIGNED有符号整型(包含正负数)
UNSIGNED无符号整型(正数)
BINARY二进制格式
convert()有两个参数,第一个为转换内容,第二个为转换类型;如:convert('123', UNSIGNED INTEGER)
cast()有一个参数,参数格式:转换内容 AS 转换类型;如:cast('123' AS UNSIGNED INTEGER)