mysql update from 子查询

mssql 子查询更新

update log set uin= b.uin
from log a,logs b
where a.accountuin = b.accountuin

mysql 不支持 update 子查询更新

找了半天资料 终于搞定了...

update `log` a inner join `logs` b on a.`accountuin` = b.`accountuin`
set a.`uin` = b.`uin` where a.`accountuin` = b.`accountuin`

这样就能 将查询出来的字段批量更新过去了...

posted @ 2014-06-24 17:49  lixiaojin  阅读(764)  评论(0编辑  收藏  举报