Dear Experts, I use PHP and mysql.
I'd like to select distinct voters from my table. Some of my users have voted more than once.
if user voted more than once, I'd like the get the latest answer.
how can I select distinct uid and answer column from my table with the latest vote?
how can I select the later vote? I want to select the last insert.
(I have an autoincrement id column on my table. )
I wrote it like this? is this correct?
SELECT DISTINCT uid,answer,city FROM mytable order by id DESC