下面的语句是sql代码。如何在bigquery中编写它? select to_number(to_char(sysdate,'yyyy')) from dual
select to_number(to_char(sysdate,'yyyy')) from dual
kyxcudwk1#
如中所述https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions尝试以下操作:
SELECT EXTRACT(YEAR FROM CURRENT_DATE()) as the_date;
5uzkadbs2#
你可以试试这个:
SELECT FORMAT_DATETIME("%Y", CURRENT_DATE()) as current_year;
2条答案
按热度按时间kyxcudwk1#
如中所述https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions
尝试以下操作:
5uzkadbs2#
你可以试试这个: