select * from dws_inventory_age
where 1=1
order by cast(inventory_age as integer)
表名dws_inventory_age,字段inventory_age是varchar类型
如下,将字段inventory_age转换成整形之后,正确排序:
如下,是不转换直接使用order by排序:
select * from dws_inventory_age
where 1=1
order by inventory_age