I have this table:
Reply_ID | Fk_Post_ID
10 | 5
9 | 6
8 | 5
7 | 9
6 | 5
5 | 9
4 | 7
I need a query retrieves records in the following order pattern. it searches for the record with the highest reply_ID then retrieves all records having the same Fk_Post_ID. something like this:
Reply_ID | Fk_Post_ID
10 | 5
8 | 5
6 | 5
9 | 6
7 | 9
5 | 9
4 | 7
Sql Fiddle Here