Created
June 26, 2021 09:32
-
-
Save James-McNeill/5d2d05f80cb90fa316e42895b57017e0 to your computer and use it in GitHub Desktop.
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
-- Using limit to select the top result | |
SELECT county, station, max(temp) as max_temp, min(temp) as min_temp | |
FROM hrly_Irish_weather | |
WHERE county = "Cork" | |
GROUP BY county, station | |
ORDER BY max_temp DESC | |
LIMIT 1; | |
-- Using limit to select the top result, adding an offset to start after the second line | |
SELECT county, station, max(temp) as max_temp, min(temp) as min_temp | |
FROM hrly_Irish_weather | |
WHERE county = "Cork" | |
GROUP BY county, station | |
ORDER BY max_temp DESC | |
LIMIT 1 | |
OFFSET 2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment