SELECT `tbl`.* FROM my_table `tbl` , (SELECT MAX(`status_on`) `last_status_on`, status_id FROM my_table GROUP BY `status_id`) `tbl_lasts` WHERE `tbl`.`status_on` = `tbl_lasts`.`last_status_on`