如文档中所述,应该可以进行多表更新。
http://dev.mysql.com/doc/refman/5.5/en/update.html
UPDATE Table_One a INNER JOIN Table_Two b ON (a.userid = b.userid)SET a.win = a.win+1, a.streak = a.streak+1, a.score = a.score+200, b.win = b.win+1, b.streak = b.streak+1, b.score = b.score+200 WHERe a.userid = 1 AND a.lid = 1 AND b.userid = 1
注意:多表不支持LIMIT,因此根据具体情况,这可能会引起更多麻烦。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)