I have a table:
mytable: id userID logDate lastLogDate
For every row in that table, I want to update the \'lastLogDate\' co
UPDATE mytable mT, (SELECT userid, MAX(logDate) AS maxDateForUser FROM mytable GROUP BY userId) t SET mT.lastLogDate = t.maxDateForUser WHERE mT.userid = t.userid;