+1 vote
in Databases by (17.2k points)

What is the equivalent of PostgreSQL’s GREATEST('2020-01-01'::date, start_date) in BigQuery? PostgreSQL’s syntax for the GREATEST function does not work in BigQuery.

1 Answer

+2 votes
by (66.6k points)
selected by
 
Best answer

In BigQuery, the equivalent of PostgreSQL’s GREATEST('2020-01-01'::date, start_date) is:

GREATEST(DATE '2020-01-01', start_date)

(DATE '2020-01-01') is the correct literal format for a date in BigQuery not ('2020-01-01'::date). 

Related questions

+1 vote
1 answer
+1 vote
1 answer
asked Jul 13, 2023 in Databases by phpuser (66.6k points)
+2 votes
1 answer

...