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

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

elasticsearch python client - work with many nodes - how to work with sniffer -