想要查询一个数据 但必须要sdetl表和SPAY表2个表的数据合并才行  请教语句怎么写

解决方案 »

  1.   

    insert into b select * from a where a.id = b.id;
      

  2.   


    insert into emp9 select * from emp;你的标题好像和你问题不太一致
      

  3.   

    如果是合并的话,用union可以;如果两个表数据不重复,用union all
      

  4.   

    所谓的"合并"指的是什么?
    1. 如果想要合并记录,使用union
       select * from A
       union
       select * from B;
    2. 如果想要合并列,要进行2个表的连接操作。
       select *
       from A, B
       where 连接条件