Reputation: 341
I am trying to get data from a Bigquery table. In where clause i want to get the data on the basis of year like 2020. I am using EXTRACT(part FROM timestamp_expression [AT TIME ZONE timezone])
Query Looks like
with input as (Select created_at as timestamp_value,user_id from `seraphic-spider-311810.Demo.table2`)
SELECT
EXTRACT(Year FROM timestamp_value AT TIME ZONE "UTC") as year_value
FROM Input
where year_value like '2020%';
Upvotes: 1
Views: 1804