Skip to content

Instantly share code, notes, and snippets.

@James-McNeill
Created June 26, 2021 11:09
Show Gist options
  • Save James-McNeill/f8c997a7964405158091a5774779b067 to your computer and use it in GitHub Desktop.
Save James-McNeill/f8c997a7964405158091a5774779b067 to your computer and use it in GitHub Desktop.
-- WINDOW functions for row_number and rank
SELECT county, station, max(temp) as max_temp, min(temp) as min_temp,
row_number() OVER win as row_number,
rank() over win as rank
FROM hrly_Irish_weather
GROUP BY county, station
WINDOW win as (ORDER BY max(temp));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment