Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Window functions don't work with aggregates
select max(p.mass) max_mass,
max(p.diameter) max_diameter,
max(p.density) max_density,
last_value(p.name) over (partition by null order by p.mass asc) lightest_planet,
p.name
from devstronomy.planet as p;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment