Skip to content

Instantly share code, notes, and snippets.

@securetorobert
Created March 24, 2021 15:19
Show Gist options
  • Save securetorobert/7f99c4c3aaa05f25a852eeaf79e3d620 to your computer and use it in GitHub Desktop.
Save securetorobert/7f99c4c3aaa05f25a852eeaf79e3d620 to your computer and use it in GitHub Desktop.
Truncate the end_date to the year in London Bicycle Hires table and group by that.
SELECT
DATE_TRUNC(DATE(end_date), YEAR)
FROM
`bigquery-public-data.london_bicycles.cycle_hire`
GROUP BY
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment