Search by age in birth date field

Asked

Viewed 360 times

-1

Hello, I have a patient table and I need a query in which the user informs an age and returns the existing records. But I don’t have the age field in the table but date of birth.

  • 1

    In a way the question has already been solved here: http://answall.com/a/16643/24260

1 answer

1


SELECT * FROM paciente
WHERE TIMESTAMPDIFF(YEAR, data_nascimento, CURDATE()) = idade

Browser other questions tagged

You are not signed in. Login or sign up in order to post.