一、
[sql]
select * from yourtable order by cast(yourcol as int);
适用于SQLServer Oracle
二、
[sql]
select * from yourtable order by convert(int,yourcol);
仅适用于SQLServer
数据库中的两个文本类型的信息相加:
update User set U_ZiDuanZhi1=(cast(U_ZiDuanZhi2 as decimal(18, 2)) + cast(U_ZiDuanZhi3 as decimal(18, 2)))
order by cast(ZiDuanZhi1 as int) 将字段变为数字类型进行排序