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;
-- 用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;