mysql query on dob
If DOB is given in this porder- 1853-03-12 , then how do we find the youngest person from table bases on this type of data. If the year is same but month is diff开发者_开发问答erent for 2 persons.
I tried MIN(dob)- it gives me the oldest person and When I tried MAX, it gives me nothing.
It's weird, however you can use ORDER BY dob DESC LIMIT 1
What's your full query ?
EDIT : resolved by email ^^
MAX should usualy do the job. maybe you have any datasets with NULL-value in that column? one thing you could try is to ORDER BY dob DESC
and LIMIT 1
.
精彩评论