Skip to main content
VeloDB Cloud 4.x·Apache Doris 3.x·"Since X.Y" tags refer to Doris versionsversion mapping →

YEAR

year

Description

Syntax

INT YEAR(DATETIME date)

Returns the year part of the date type, ranging from 1000 to 9999

The parameter is Date or Datetime type

example

mysql> select year('1987-01-01');
+-----------------------------+
| year('1987-01-01 00:00:00') |
+-----------------------------+
| 1987 |
+-----------------------------+

keywords

YEAR