update statement using nested query

后端 未结 6 1807
梦谈多话
梦谈多话 2020-12-14 06:33

I have a table:

mytable:
    id
    userID
    logDate
    lastLogDate

For every row in that table, I want to update the \'lastLogDate\' co

6条回答
  •  臣服心动
    2020-12-14 07:00

    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:

    UPDATE `mytable`
    SET lastLogDate = (SELECT statement goes here)
    WHERE ...
    

提交回复
热议问题