I have the following table:
Use distinct on:
distinct on
select distinct on (day) t.* from t order by day, val desc;
755k questions
754k answers
5 comments
53.3k users