日期:2014-05-18  浏览次数:20510 次

从两个表中找出相同名字字段数据
问题是这样的:
      我有两个表,分别为tableA,tableB,两个表有一个共同的字段   ,字段名是     sh
我希望把两个表的该字段都找出来,显示在一列中,去掉重复。
select   sh   from   tableA
select   sh   from   tableB       这样显示的结果在两个表格中

select   tableA.xh,tableB.xh   from   tableA,tableB    
这样显示的结果在两列

高手求助!!

------解决方案--------------------
select sh from tableA
Union
select sh from tableB
------解决方案--------------------
用union 自动去掉重复的啦
------解决方案--------------------
select sh from tableA
Union
select sh from tableB