How to Get the First or Last Value in a Group Using Group By in SQL
Getting the last value of a group in an aggregated query in PostgreSQL is a challenging task. In this article we present a simple way to get the first or last value of a group using group by.