I want to sort the result first by date and then by id.
I used the query
SELECT payment_date,project_id FROM `payments` ORDER BY payment_date desc, project_id desc
But it did not work. I want first sort the data by date and get the project id who have max date after that records below first row show all the date based on particular project id.
like
Please help me to get the result as below:
Here is the Data table http://sqlfiddle.com/#!9/f2358/5