Files
doris/docs/documentation/en/sql-reference/sql-functions/date-time-functions/year_EN.md
2019-08-30 22:07:24 +08:00

399 B

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') 124year;
+-----------------------------+
|                        1987 |
+-----------------------------+
##keyword
YEAR