truncate table b
create table b as select * from a

解决方案 »

  1.   

    truncate table b;
    insert into b
    select * from a;
      

  2.   

    insert into B (BB)
      select AB from A这样的话,你需要将B 表的BA字段设置为可以自动增加
      

  3.   

    update b set b.bb=(select ab from a  where b.ba=a.aa )
      

  4.   

    同意楼上
    update b set b.bb=(select ab from a  where b.ba=a.aa )
      

  5.   

    我可能没有把意思写清楚,例子也给的不好。表A
    AA  AB  AC ***
    10   F   ***
    22   H   ***
    34   J   ***
    98   I   ****表B
    BA  BB  BC BD***
    10    K  *****
    34    I  *****
    22    J  *****表B的 BA列的值集 是 表A的AA列值集 的子集
    目的:使表B的BB列与表A的AB列一致。不用游标或函数,直接用sql语句。所以一二楼的不是我想要的。3楼的不对吧。
    四五楼的我得验证一下。