Reputation: 2541
I noticed that there is an inconsistent result from Date Function in Standard SQL and Legacy SQL,
In standard SQL, current_date()
returns a DATE data type, however, in Legacy SQL, current_date()
returns a String data type.
Then, If I create a table which has 'Date' column by using Standard SQL, later on, when I querying the table using Legacy SQL, I have to format 'Date' from Date Data Type To String Data Type, or the other way around.
Unlike Timestamp Data Type, I can query the same table across different SQL Language. Is there an easy way to query in Standard SQL and legacy SQL without converting between Data type and String type?
Thank you in advance.
Upvotes: 0
Views: 1735
Reputation: 33705
Legacy SQL has very limited support for the civil time types, so you're better off sticking with standard SQL if possible.
Upvotes: 1