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