sql按照指定顺序排序的写法

 

-- 用FIND_IN_SET(state,'0,1,4,2,3,5,6') 可以按照指定的'0,1,4,2,3,5,6'状态进行排序

SELECT * FROM qua_prod_return
ORDER BY FIND_IN_SET(state,'0,1,4,2,3,5,6'), prod_return_id desc;

posted @ 2023-11-16 09:06  十一点  阅读(319)  评论(0编辑  收藏  举报