Postgres Subquery: CTEs, window functions and more | Dark Hacker News