Condividi tramite


Funzione year

Si applica a: segno di spunta sì Databricks SQL segno di spunta sì Databricks Runtime

Restituisce il componente anno di expr. Questa funzione è un sinonimo di extract(YEAR FROM expr).

Sintassi

year(expr)

Argomenti

  • expr: espressione DATE o TIMESTAMP.

Valori restituiti

An INTEGER.

Esempi

> SELECT year('2016-07-30');
 2016