Laravel get row with the max of a column, group by some cols

2022/01/25閱讀時間約 1 分鐘
如上圖資料,想要group by g_id找到最大update_datetime的row:
XXX::whereRaw('update_datetime in (select max(update_datetime) from xxx GROUP BY (g_id))')
->get();
為什麼會看到廣告
20會員
161內容數
留言0
查看全部
發表第一個留言支持創作者!