Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
返回指定日期中的年份,范围1000到9999。
INT YEAR(DATE|DATETIME date)
date
year('string')
year(3.1415)
1987
select year('1987-01-01'); +--------------------+ | year('1987-01-01') | +--------------------+ | 1987 | +--------------------+ 1 row in set (0.00 sec)
select year(now()); +-------------+ | year(now()) | +-------------+ | 2022 | +-------------+ 1 row in set (0.00 sec)