让mysql返回的结果按照传入的id的顺序排序

比如id为 1,3,5,44,66,32,21,6 那么返回的结果顺序也是这个顺序
 
$sql = "select * from ".$this->tableName()." where id in ($ids) order by field(id, ".$ids.") ";
原文地址:https://www.cnblogs.com/dongruiha/p/7146980.html