1. 函数向日期添加指定的时间间隔
DATE_ADD(date,INTERVAL expr type)
eg:DATE_ADD(CURDATE(),INTERVAL 1 MONTH) //在当前时间加一个月
2.计算年龄
eg:select birth ,CURDATE, YEAR(CURDATE())-YEAR(birth) - (RIGHT(MONTH(CURDATE),5) < RIGHT(MONTH(birth),5)) as age from pet;
birth CURDATE age
1998-09-11 2003-08-19 4
YEAR() 获取年,MONTH() 获取月,day() 获取天
原文:http://www.cnblogs.com/zouzhe0/p/6189575.html