for MySQL, MariaDB, AWS Aurora (MySQL), Postgres & AWS Aurora (Postgres)
- A very common SQL problem everyone come to at some point is to get the latest or current entry over a given group.
- It is often solve quite complex with
GROUP BY
and subqueries. - The objective of this GIST is to show a simple reuseable way to solve this specific problem.
- It is very intuitve that the created index directly shows up in the
PARTITION BY
orORDER BY
statements - The query is very human-readable and easy to understand
- It is very intuitve that the created index directly shows up in the