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的数据整合到一个表里
id name phone
B表
porttime id name phone2个表的id name phone字段类型都一样B表的数据是A表导过去的,加了个porttime字段我现在要同时得到A表数据和B表数据怎么写?就是A的 id name phone和B的 id name phone的数据整合到一个表里
union all
select id,name,phone from b
union
select id ,name ,phone from b
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
这样?
union
select id,name,phone from B
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
没有的话可以用
select id name phone from A
union
select id name phone from B
union all
select id,name,phone from b