I have the following table:
Use distinct on:
distinct on
select distinct on (day) t.* from t order by day, val desc;
1.4m articles
1.4m replys
5 comments
57.0k users