I have a table with names and birthday year of doctor. On index page i need to show only doctors who is undex 40 years old. I need to subtract birthday year from current year and show only result under 40 ...
SELECT * FROM `doctor` WHERE dateadd(year, `date_birthday`, getdate())
i try to cast the date sa datetime to date as year, but everytime it is return NULL
SELECT id,CAST((CURDATE()-date_birthday) AS DATE) AS difference FROM doctor