Skip to content

Instantly share code, notes, and snippets.

@alexanno
Last active February 3, 2016 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanno/f780fdabe22be122d01c to your computer and use it in GitHub Desktop.
Save alexanno/f780fdabe22be122d01c to your computer and use it in GitHub Desktop.
Kurs og bedriftspresentasjon for NMBU 3. februar 2016
SELECT
f.cartodb_id,
f.the_geom_webmercator,
f.the_geom,
count(o.cartodb_id) antall_o,
sum(o.omsetningsbeloep) totalsum,
sum(o.omsetningsbeloep)/(st_area(f.the_geom)/1000) belopkm2
FROM kommuner f left join omsetninger o on st_intersects(f.the_geom,o.the_geom) group by f.cartodb_id,f.the_geom_webmercator,f.the_geom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment