1. 程式人生 > >mysql 按值排序

mysql 按值排序

pre code lar aud sql toarray get raw highlight

order by FIELD(AuditorStatus,3,0,1,2)

laravel 寫法

$data   = $query->orderByRaw(\DB::Raw(‘FIELD(AuditorStatus,3,0,1,2)‘))->get()->toArray();

  

mysql 按值排序