I have a table like this:
id (PRIMARY KEY, AUTO_INCREMENT) || user_id || timestamp || data1 || data2 || data3 (...)
I need to extract a single data for every user_id ("the newest row") that is, with respect to latest timestamp in the table.
The answer given here works fine, but I am concerned with performance of this query: MySQL - using GROUP BY and DESC
I have also tested some answers here, but receive "Too few arguments" error and empty query: https://stackoverflow.com/a/7306288/2715309
Select only newest grouped entries
What am I doing wrong and what is the most optimal way, given the fact that I have unique auto_inc column as primary key?
Thanks