MySQL根据生日获取年龄

SELECT birthday,CURDATE(),(YEAR(CURDATE())-YEAR(birthday))-(RIGHT(CURDATE(),5)<RIGHT(birthday,5)) AS age FROM talent_lib LIMIT 2;


原文地址:http://www.beijibear.com/?aid=433

你可能感兴趣的:(mysql)