SELECT a.CID, a.FNAME, DATE_FORMAT(FROM_DAYS(DATEDIFF(CURDATE(), a.birthdate)),'%y') AS age_y,
DATE_FORMAT(FROM_DAYS(DATEDIFF(CURDATE(), a.birthdate)),'%c') AS age_m,
DATE_FORMAT(FROM_DAYS(DATEDIFF(CURDATE(), a.birthdate)),'%e') AS age_d
FROM population a limit 3
ไม่มีความคิดเห็น:
แสดงความคิดเห็น