时间:2021-07-01 10:21:17 帮助过:57人阅读
相关mysql视频教程推荐:《mysql教程》
//MySQL 语句SELECT * FROM `MyTable`WHERE `id` IN (11,1,111) ORDER BY FIELD(`id`, 11,1,111);
laravel 框架
$ids = array(1,17,2); $ids_ordered = implode(',', $itemIds); $items = static::whereIn('id', $ids)->orderByRaw(DB::raw("FIELD(id, $ids_ordered)"))->get();
以上就是mysql中order by in 的字符顺序(推荐)的详细内容,更多请关注Gxl网其它相关文章!