mysql - presenting age more than [number] from birth date in sql -


i have table called dependent:

enter image description here

and need present dependents more 40 years old example.

p.s. right trying use datediff(curdate(), dependent.bdate)/365.25 function, still can't present it. how this?

assuming bdate actual date column, think easier create date 40 years prior current date , select bdate less-than or equal date

where dependent.bdate <= date_sub(curdate(), interval 40 year) 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

linux - gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now -

sql - MySQL - Finding Empty relations -