intermediate select MySQL MariaDB SQL Server PostgreSQL SQLite
Select the First Row Per Group With DISTINCT ON
Use PostgreSQL's `DISTINCT ON (col)` to keep only the first row for each unique value of a column, with `ORDER BY` controlling which row within each group is considered first.