select * from table where id IN (3,6,9,1,2,5,8,7) order by field(id,3,6,9,1,2,5,8,7); 通过in方式查找数据,且数据按in的顺序排序