与
ESC
输入关键词搜索文章

mysql按in使用 field方法排序

全文约 60 字预计阅读 1 分钟
假设test表中有A,B字段 id字段中有19, 23, 21, 2, 129... 要求:19, 23, 21, 2, 129剩下的按照b字段正序排列 select * from test order by field(a,19,23,21,2,129) desc , b asc 效率有待考证
mysql按in使用 field方法排序
分享

发表评论

评论 0 条

暂无评论,来说点什么吧。