首页 > 代码库 > mysql计算年龄

mysql计算年龄

YEAR(CURDATE())-YEAR(addtime)-(RIGHT(CURDATE(),5)<RIGHT(addtime,5))addtime=2006-11-2mysql> SELECT id,  YEAR(CURDATE())-YEAR(addtime)-(RIGHT(CURDATE(),5)<RIGHT(addtime,5))   FROM user  where id=109480来自:http://www.cnblogs.com/fenglie/p/3985521.html

 

mysql计算年龄