select * from product where id in (3,4,8,5,1,6,2,7) 并不会按查询的id顺序返回数据,添加
order by
field就可以解决,如select * from product where id in (3,4,8,5,1,6,2,7) order by field(id,3,4,8,5,1,6,2,7);
2021-09-05 04:02:36
select * from product where id in (3,4,8,5,1,6,2,7) 并不会按查询的id顺序返回数据,添加
order by
field就可以解决,如select * from product where id in (3,4,8,5,1,6,2,7) order by field(id,3,4,8,5,1,6,2,7);