I have a table with 3 fields:
ID
(not unique, not primary key)timestamp
marker
I want to get the last entry for every distinct ID
, but when I doSELECT ID, max(timestamp) from table GROUP BY ID
the marker field is wrong.
I have another table with the following fields:
ID
(unique, primary key)lat
lng
I would like to perform the same query but with the lat
and lng
fields as well, but since I can't do the first step, I don't know what kind of query should I use. I've been trying with no success.
Could someone point me in the right direction? Thanks a lot.