This might be quite easy but have no idea how to.
I have a table that can have repeated values for a particular non-key column field. How do I write a SQL query usin
Note that groupBy as used above won't work for postgres.
groupBy
Using distinct is probably a better option - e.g. $users = User::query()->distinct()->get();
distinct
$users = User::query()->distinct()->get();
If you use query you can select all the columns as requested.
query