Last active
January 8, 2023 10:39
-
-
Save mbforr/f9c61d7c7825d9ae5e037f0dd9e693cd 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
select | |
state_name | |
from | |
`bigquery-public-data.geo_us_boundaries.states` | |
where | |
st_touches(state_geom, | |
( | |
select | |
state_geom | |
from | |
`bigquery-public-data.geo_us_boundaries.states` | |
where | |
state_name = 'Virginia')) | |
# this query will select all states that touch Virginia | |
# we can select the geometry of Virginia in a subquery | |
# which will return all the states it touches in our main query |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment