Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 406 Bytes

File metadata and controls

28 lines (19 loc) · 406 Bytes

year

description

Syntax

INT YEAR(DATETIME date)

返回date类型的year部分,范围从1000-9999

参数为Date或者Datetime类型

example

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

keyword

YEAR