I am trying to calculate how old is a person in a database. Let\'s suppose to have this simple table:
student(id, birth_date);
Where
For anyone who comes across this:
another way this can be done is:
SELECT TIMESTAMPDIFF(YEAR, date_of_birth, CURDATE()) AS difference FROM student
For differences in months, replace YEAR with MONTH, and for days replace YEAR with DAY
YEAR
MONTH
DAY
Hope that helps!