如何在bigquery中编写下面的sql查询

rm5edbpk  于 2021-07-24  发布在  Java
关注(0)|答案(2)|浏览(377)

下面的语句是sql代码。如何在bigquery中编写它? select to_number(to_char(sysdate,'yyyy')) from dual

kyxcudwk

kyxcudwk1#

如中所述https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions
尝试以下操作:

SELECT EXTRACT(YEAR FROM CURRENT_DATE()) as the_date;
5uzkadbs

5uzkadbs2#

你可以试试这个:

SELECT FORMAT_DATETIME("%Y", CURRENT_DATE()) as current_year;

相关问题