Example:
Columns:
id, date(mysql date), other fields....
Rows:
1, 2011-01-11
2, 2011-31-10
3, 2011-30-10
4, 2011-25-09
5, 2011-25-09
6, 2011-25-09
7, 2011-21-09
Mysql select statement to select the last date of every month in given rows… not just unique… if in a month the last date has more than 1 row then need to retrive all rows of that last date.
Considering the above example select statement should give the following result set
1, 2011-01-11
2, 2011-31-10
4, 2011-25-09
5, 2011-25-09
6, 2011-25-09
This will get you the right rows: