Laravel 8 groupByRaw
groupByRaw 方法可以用于将原生字符串设置为 group by 语句的值:
$orders = DB::table('orders')
->select('city', 'state')
->groupByRaw('city, state')
->get();
groupByRaw 方法可以用于将原生字符串设置为 group by 语句的值:
$orders = DB::table('orders')
->select('city', 'state')
->groupByRaw('city, state')
->get();