Created
February 11, 2016 15:29
-
-
Save uekeueke/d9ddcc2faada06c80f5e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| with markets as ( | |
| select * from iaac_cac where bcn3 = 'MERCATS') | |
| , | |
| nonmarkets as ( | |
| select * from iaac_cac where bcn3 != 'MERCATS' | |
| ) | |
| select | |
| row_number() over() as cartodb_id, | |
| count(*), | |
| markets.the_geom_webmercator as the_geom_webmercator | |
| from markets, nonmarkets where | |
| st_intersects(st_buffer(markets.the_geom_webmercator, 100) ,nonmarkets.the_geom_webmercator) | |
| group by markets.the_geom_webmercator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment