I have the following:
SELECT * FROM (SELECT * FROM table ORDER BY id DESC) t GROUP BY pcid
SELECT * FROM (SELECT * FROM table ORDER BY timestamp DESC) t GROUP BY pcid
I am unable to get the GROUP BY to be in the correct order. It always pulls from the lowest value.
Am I missing some syntax that is oblivious to me?
After looking for the past several hours to find a solution to this issue, I have been unable to resolve. This question has been asked because I have been unable to find the answer.
Here is my table structure:
table id,primary pcid cpu memphy memcom memvir timestamp
I have tried sorting by timestamp and id with no luck.