Query the row with the greatest/least value per group.
I have two tables, say "users" and "users_actions", where "users_actions" has an hasMany relation with users: users id | …
php laravel-5 eloquent greatest-n-per-group eager-loadingI have a query something like SELECT S.product_id, S.link, C.id AS category_id FROM Products P …
sql sql-server greatest-n-per-group