SQL ReferenceSQL 函数日期函数YEAR本页总览YEARyeardescriptionSyntaxINT YEAR(DATETIME date)返回date类型的year部分,范围从1000-9999参数为Date或者Datetime类型examplemysql> select year('1987-01-01');+-----------------------------+| year('1987-01-01 00:00:00') |+-----------------------------+| 1987 |+-----------------------------+keywordsYEAR