I have a table:
mytable:
id
userID
logDate
lastLogDate
For every row in that table, I want to update the 'lastLogDate' column to be the max value of logDate on a per user basis...
Conceptually, each user should have a lastLogDate = the value that is returned by:
select max(logDate) from mytable group by userID
Can somebody help me write the update statement for that?
Something like this?
You can do this:
you can simply write a nested query like this
I don’t know if I understood you correctly. Otherwise be a bit more specific, but from what I get, you should do something along the lines of:
Following update statement should do what you are looking for