I have a table like this
CREATE TABLE `filelog` (
`date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`file` varchar(200) DEFAULT NULL,
`action` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
action could have values 'upload' and 'delete'
I have a list view where the files that are uploaded are displayed for deletion. The problem is that the same file could be deleted and again uploaded numerous times and this is a log table where all these action are inserted. So the query should display the files with action 'upload' where the most recent action 'delete' took place before the 'upload' action.
order by date_time desc?