【2020090404】日期函数--mysql

day() -----取时间字段的“天”

month() ----取时间字段的“月”

year() -----取时间字段的“年”

例:

1 -- 查询1990年出生的学生名单(注:Student表中Sage列的类型是datetime)
2 
3 SELECT *
4 FROM student
5 WHERE YEAR(sage) = '1990'
原文地址:https://www.cnblogs.com/zhouxue0621/p/13614533.html