Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Maptime Seattle Postgis - Problem 3
WITH states_with_railroads AS (
SELECT DISTINCT s.name
FROM geo.states_ne s
INNER JOIN geo.railroads_ne r ON ST_Intersects(s.geom, r.geom)
WHERE admin='United States of America'
)
SELECT DISTINCT s.name
FROM geo.states_ne s
WHERE admin='United States of America'
AND s.name NOT IN (SELECT * FROM states_with_railroads)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment