i have a table that has
Month, Year, Country, Disaster
8, 2001, afghanistan, drought
7, 2001, afghanistan, drought
7, 2000, afghanistan, flood
5, 2001, united states, flood
10, 2001, afghanistan, earthquake
4, 1980, france, flood
6, 1954, afghanistan, drought
etc.
I need to find the most recent date and the oldest date for each country. so with my example dataset I have it printing out something like this
$country Disaster History: From $lastdate To: $firstdate
Afghanistan Disaster History: From 6/1954 To: 10/2001
does that make sense now? I have hundreds of records to check.
I guess that's why I don't understand why select max(month) max(year) from table where country like '$country' group by year order by year desc wouldn't work.