如何将字符串转换成整型(mySQL)_喜悦成功_新浪博客,喜悦成功,
来源: 如何将字符串转换成整型(mysql)_喜悦成功_新浪博客
cast(字段 as unsigned)
例如1:把表结构中的name(字符串) 字段转化成整型
cast(name as unsigned)
应用:将表A记录按name 字段从小到大排列
select * from A order by cast(name as unsigned);
如何将字符串转换成整型(mySQL)_喜悦成功_新浪博客,喜悦成功,
来源: 如何将字符串转换成整型(mysql)_喜悦成功_新浪博客
cast(字段 as unsigned)
例如1:把表结构中的name(字符串) 字段转化成整型
cast(name as unsigned)
应用:将表A记录按name 字段从小到大排列
select * from A order by cast(name as unsigned);