I have calculated age from date of birth but I would like to select greater than 55 only in a stored procedure. Below is what I have done.
DELIMITER //
CREATE PROCEDURE p6()
BEGIN
SELECT Firstname, Lastname, telephone_number, TIMESTAMPDIFF(YEAR,DOB,CURDATE()) AS age
FROM Staff
WHERE Job_title = 'instructor';
END //
DELIMITER ;
MySQL has an extension where you can use
having
for this purpose: