A表 
id name phone
B表
porttime id name phone2个表的id name phone字段类型都一样B表的数据是A表导过去的,加了个porttime字段我现在要同时得到A表数据和B表数据怎么写?就是A的 id name phone和B的 id name phone的数据整合到一个表里

解决方案 »

  1.   

    SELECT * FROM A,B WHERE A.ID=B.ID AND A.NAME=B.NAME AND A.PHONE=B.PHONE不理解是插入,还是查询呀
      

  2.   

    select id,name,phone from a
    union all
    select id,name,phone from b
      

  3.   

    select id ,name ,phone from a
    union
    select id ,name ,phone from b
      
      

  4.   


    insert into C(id,name,phone,porttime)
    select distinct A.id,A,name,A.phone,B.porttime
    from A
    join B on A.id = B.id and A.name = B.name and A.phone =B.phone
    这样?
      

  5.   

    select * from A
    union 
    select id,name,phone from B
      

  6.   


    insert into [table] select id,name phone from A
    insert into [table] select id,name phone from Binsert into [table] select t1.id,t1.name,t1.phone,t2.name,t2.phone  from A t1,B t2 where t1.id=t2.id
      

  7.   

    select * from A,B where A.id=B.id 
      

  8.   

    A表跟B表有没有重复?
    没有的话可以用
    select id name phone from A
    union
    select id name phone from B
      

  9.   

    用union all是正解select id,name,phone from a
    union all
    select id,name,phone from b