in sql 按顺序输出
解决方案
- 方式一
select * from ipm_host_button where id in (1,2,3,6,4,5) order by
find_in_set(id , '1,2,3,6,4,5')
- 方式二
select * from ipm_host_button where id in (3,6,9,1,2,5,8,7) order by field(id,3,6,9,1,2,5,8,7);
select * from ipm_host_button where id in (1,2,3,6,4,5) order by
find_in_set(id , '1,2,3,6,4,5')
select * from ipm_host_button where id in (3,6,9,1,2,5,8,7) order by field(id,3,6,9,1,2,5,8,7);