批量更新sql |批量update sql

 

图所示需要批量更新table2表内字段Pwd更新userName对IP地址username与Ip对应关系table1所示

 

 

 

update table2 set pwd=table1.ip from table1 inner join table2 on table1.username=table2.username

UPDATE TABLE2 A  SET A.PWD =(SELECT  B.IP FROM  TABLE1 B WHERE B.userName =A.userName)

 

posted @ 2014-04-22 17:09  dapeng888  阅读(1036)  评论(0编辑  收藏  举报