postgresql 某个列按特定顺序排序
postgresql吧
全部回复
仅看楼主
level 1
郭喜明👀 楼主
最近有一个需求,需要将订单的状态按照特定的顺序排序(3,4,0,1,5,6,2,7按照这种顺序来排序),我数据库是Postgresql,status列的类型是int,我之前使用过
select status from warehouse.orders order by position(substring(to_char(status,'0') from 1 for 1) in '34015627');没能得到想要的结果,求助一下大神,有什么方法能解决!
2017年02月14日 06点02分 1
level 1
PostgreSQL 排序后 Limit OFFSET 分页 串行 问题解决办法
http://www.xttblog.com/?p=1112
2017年03月06日 03点03分 2
1