Mysql按数字大小排序String字段
2018-09-19 本文已影响0人
IBM_LELE
xaddress表中 address是string 类型,要实现 address 的数字排序。
SELECT * from xaddress where CoinType='ST' ORDER BY address desc;
可行方案
SELECT * from xaddress where CoinType='ST' ORDER BY -address asc;
_________
SQL 方式
select Address from coldaddress where CoinType='STM' order by cast(Address as int) asc