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