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.
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.
SELECT * FROM paciente
WHERE TIMESTAMPDIFF(YEAR, data_nascimento, CURDATE()) = idade