注:两表为同一用户所建!!table1sum,table2sum 分别为table1,table2的字段名..

解决方案 »

  1.   

    update table1 set table1sum=(select table2sum from table2 where table1.no=table2.no)
    where exists(select 1 from table2 where table1.no=table2.no);
      

  2.   

    谢谢
    请问where exists(select 1 from table2 where table1.no=table2.no);
    这里面的1是指什么啊?
      

  3.   

    请问where exists(select 1 from table2 where table1.no=table2.no);
    表示只更新能更新的部分 否则table1中不在table2中存在的no的table1sum会更新成空值