Skip to content

Instantly share code, notes, and snippets.

@mbforr
Created July 31, 2021 03:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mbforr/b5722e38f98342cd2f91a1090c9e4c8f to your computer and use it in GitHub Desktop.
Save mbforr/b5722e38f98342cd2f91a1090c9e4c8f to your computer and use it in GitHub Desktop.
SELECT
state_name,
CASE
WHEN state_name IN ('Minnesota', 'Wisconsin', 'Iowa', 'Illinois', 'Indiana', 'Ohio', 'Michigan', 'Missouri', 'Kansas', 'Nebraska', 'North Dakota', 'South Dakota') THEN 'Midwest'
ELSE
'Not Midwest'
END
AS midwest
FROM
`bigquery-public-data.geo_us_boundaries.states`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment