DROP TABLE TAB1;CREATE TABLE tab1 AS
   SELECT a,b,c FROM TAB2 WHERE d IS NULL;OK?

解决方案 »

  1.   

    DELETE FROM TAB1 WHERE ...;INSERT INTO TAB2(a,b,c)
    SELECT a,b,c FROM TAB2 WHERE d IS NULL;COMMIT;OK?
      

  2.   

    兄弟,你好像没看懂题义,需用UPDATE语句!
      

  3.   

    真够折腾的!用CURSOR,一条条的搞吧!
      

  4.   

    Update tab1 set c=tab2.c 
    from tab1 inner join tab2 on tab1.a=tab2.a and tab1.b=tab2.b
    where tab2.d is null
      

  5.   

    update tab1 set c = tab2.c where tab2.d is null and a = tab2.a and b = tab2.b
    OK,no problem!
      

  6.   

    update tab1
    set c= (select c from tab2 
              where d is null and a=tab1.a and b=tab1.b)
      

  7.   

    update tab1
    set tab1.c=tab2.c where 
    tab2.d is null and tab1.a=tab2.a and tab1.b=tab2.b;
      

  8.   

    update tab1 set c=(
      select c from tab2
          where d is null and tab2.a=tab1.a and tab2.b=tab1.b)
      

  9.   

    update tab1 set tab1.c=(select c from tab2  where tab1.a=tab2.a and tab1.b=tab2.b and tab2.d is null);
      

  10.   

    tab2的主键是什么?
    前提都必须满足子查询的返回值唯一如果tab2的主键是(a,b)的话,上面的都是正确的,你还可以试试
    update 
    (select a.c ac,b.c bc
      from tab1 a,tab2 b
     where a.a = b.a
       and a.b = b.b
       and b.d is null)
    set ac = bc