Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT
n.name AS neighborhood_name,
SUM(m.kw) / AREA(r.border) AS kw_per_m2
FROM neighborhoods AS n
INNER JOIN meters AS m
ON CONTAINS(n.border, m.loc)
ORDER BY kw_per_m2 DESC
LIMIT 3
neighborhood_name kw_per_m2
----------------- ---------
Pawtucketville 1247.79
Belvidere 1004.37
Highlands 998.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.