我有一个包含列的表'lot_login_tracking':
lot_i_login_id is primary key & auto inc
lot_i_login_id lot_i_user_id lot_d_login_stamp lot_d_logout_stamp
1 1296 2013-07-11 09:18:32 NULL
2 1296 2013-07-11 09:55:38 NULL
3 1296 2013-07-11 09:57:38 NULL
用户注销时我正在执行以下查询:
UPDATE lot_login_tracking SET lot_d_logout_stamp = "2013-07-11 19:28:21"
WHERE lot_i_login_id = ( SELECT max(lot_i_login_id)
FROM lot_login_tracking WHERE lot_i_user_id = 1296)
并得到一个错误:
ERROR 1093 (HY000): 您不能在 FROM 子句中指定目标表 'lot_login_tracking' 进行更新。
如何解决?