'Show results of employees whose age is equal to 65
Show results of employees whose age is equal to 65. I want to get results whose age is 65 , i.e if any employee age comes to 65 years on 24-02-2022 his results I want to show, after 25-02-2022 his results should not display for the total 12 months, want to show for only one day. Any help
SELECT id,
first_name,
last_name,
floor(datediff(CURDATE(),date_of_birth)/365) as age,
date_of_birth
from employee
where floor(datediff(CURDATE(),date_of_birth)/365)=65;
Sample data
employee name - James
date of birth - 1957-02-24
age - 65
At this date he is 65 years and should not display after this date, i.e from 25-02-2022
to 24-02-2023
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|