catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

Real Postgres "DISTINCT ON" query... #1110

Open Foddy opened 8 months ago

Foddy commented 8 months ago

Hi,

does anyone know how I can make this query using Medoo's select function? I hope I can avoid using the raw query method:

SELECT DISTINCT ON (guests."group") *
FROM guests

I'm unfortunately not making progress with the distinct function in the documentation. The results are completely different. My goal is to only retrieve the first entry when multiple rows have the same group ID.

Foddy commented 7 months ago

No one... 😮‍💨?