I am having issues implementing a sub-select solution for ORDERING a resulting dataset before the GROUP BY reduces it.
Normally, in SQL you would do a sub-select:
SELECT * FROM (
SELECT * FROM a_table order by a_table.timestamp desc
) as table_tmp
group by userId
However, I am having difficulty implementing this in DQL. Can anyone point me in the right direction please?
My query is more complex than this and I assume I JOIN other tables through 'table_tmp' and in the outer SELECT.
Thanks.