当前位置: 代码迷 >> Sql Server >> 两个表和并有关问题
  详细解决方案

两个表和并有关问题

热度:99   发布时间:2016-04-27 16:47:37.0
两个表和并问题
A,B两个表结构一样,怎样查出两个表里的所有数据
select   *   from   a,b
这样写会有很多多余的数据出来

------解决方案--------------------
select * from A
union all
select * from B
------解决方案--------------------
不去掉重复数据
select * from A
union all
select * from B

去掉重复数据
select * from A
union
select * from B
  相关解决方案