Skip to content

Instantly share code, notes, and snippets.

@sararob
Last active August 12, 2019 21:47
Show Gist options
  • Save sararob/d9ed1fcb61112aa6e0f5e6727408c51e to your computer and use it in GitHub Desktop.
Save sararob/d9ed1fcb61112aa6e0f5e6727408c51e to your computer and use it in GitHub Desktop.
The life of Citibike # 17526
# Enable Standard SQL to run this query
# More on BigQuery here: https://cloud.google.com/bigquery/docs/quickstarts
SELECT
REGEXP_REPLACE(starttime, '([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})', '\\3-\\1-\\2') as starttime,
from_station_lat,
from_station_lng
FROM `sara-bigquery.nyc_citibike.trips_*`
WHERE cast(bikeid as int64) = 17526 # This is the bike with the most trips (found from another query)
order by starttime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment