Search by age in field of date of birth

-1

Hello, I have a patient table and I need a query in which the user informs an age and returns the existing records. However I do not have the age field in the table but rather date of birth.

    
asked by anonymous 11.05.2015 / 20:00

1 answer

1
SELECT * FROM paciente
WHERE TIMESTAMPDIFF(YEAR, data_nascimento, CURDATE()) = idade
    
11.05.2015 / 20:03