I have the following table:
Use distinct on:
distinct on
select distinct on (day) t.* from t order by day, val desc;
548k questions
547k answers
4 comments
86.3k users