tags:

views:

25

answers:

2

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 different for 2 persons.

I tried MIN(dob)- it gives me the oldest person and When I tried MAX, it gives me nothing.

A: 

It's weird, however you can use ORDER BY dob DESC LIMIT 1

What's your full query ?

EDIT : resolved by email ^^

MatTheCat
I used it, but still getting the old value
shilps
Definitely weird. What's your tables structure and your query ?
MatTheCat
I cant paste the query here because its a hw and anybody can copy my query from here. I have 2 files and tehre are various columns in it. I am need the youngest dob to restrict my query to perform specific funtion. IF you say, I can email you my query.
shilps
check your email
shilps
Ok i've received it I take a look.
MatTheCat
A: 

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.

oezi