mysql querying age from dob
Posted
by Confused
on Stack Overflow
See other posts from Stack Overflow
or by Confused
Published on 2010-03-26T20:29:26Z
Indexed on
2010/03/26
20:33 UTC
Read the original article
Hit count: 115
My MySQL database has date of birth stored in the format yyyy-mm-dd, how do I query the database - without using php code - to show me results of people born within x years of now, and/or, who are y years of age?
The table is called users, the colum is called dob. I've spent a while viewing the MySQL manual but I can't work out precisely how to form my query.
So far I went for select * from users where dob...
but I don't think that's the way to go.
© Stack Overflow or respective owner