I have the following command:
SELECT * FROM Posts P
INNER JOIN (SELECT DISTINCT ThreadId FROM Posts ORDER BY Time DESC) R
ON P.Id = R.ThreadId;
This command selects threads who contain the newest replies. Unfortunately the order of the threads seems to be random. I want the threads to be ordered by the newest replies. In other words: I want my selection to keep the order which I used inside my inner join.
How can I achieve this?