两个完全相同的表,只是存放的是不同类型的数据。我现在要将一个表中的一行数据转移到另外一个表中。
例:表A和表B
都具有属性:id,name,tel,emailA:
id  name  tel  email
1   a     123  [email protected]
2   b     234  [email protected]
id  name  tel  email
1   c     345  [email protected]现在将A中a行转移到B中...谢了!

解决方案 »

  1.   

    INSERT INTO B
    SELECT * FROM A WHERE A.name = 'a'
      

  2.   

    insert into B select * from A where A.name='a'
      

  3.   

    insert into B
    select * from A
    where A.name='a'
      

  4.   

    insert into B 
    SELECT * FROM A WHERE A.name = 'a'
    1、说明:复制表(只复制结构,源表名:a 新表名:b) (Access可用) 
    法一:select * into b from a where 1 <>1 
    法二:select top 0 * into b from a 2、说明:拷贝表(拷贝数据,源表名:a 目标表名:b) (Access可用) 
    insert into b(a, b, c) select d,e,f from a; 
      

  5.   

    insert into B select * from A where A.name='a'
      

  6.   

    insert into B select * from A where A.name='a'
    如果要删除A表中的数据加上:
    delete A where A.name='a'
      

  7.   


    insert into B
    select * from A
    where A.name='a'
    go
    delete A
    where name='a'