postgresql使用sql或者hql语句对varchar类型的字段进行排序

使用sql语句,如下

SELECT tcwz FROM biao t  order by cast(t.tcwz as INTEGER);

使用hql语句,如下

。。。+ order by cast(t.tcwz as int);

猜你喜欢

转载自blog.csdn.net/MangLi/article/details/84532486