新技能GET-mysql根据in条件的顺序排序
2017-10-10 本文已影响41人
疯狂的潜水员
mysql根据in条件的顺序排序
select * from t_user u
where u.user_id in ('123','456','789')
order by field(u.user_id,'123','456','789')
select * from t_user u
where u.user_id in ('123','456','789')
order by field(u.user_id,'123','456','789')