Last active
May 17, 2020 12:49
-
-
Save kovid-r/64ce0b2022114e0cfcaf343e370fc93e to your computer and use it in GitHub Desktop.
Window functions don't work with aggregates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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