select * from 表1 
union
select * from 表2

解决方案 »

  1.   

    select 销售时间, 销售单号, 物料编码
    , 销售数量=case when exists(select 1 from 表2 where 销售时间=a.销售时间 and 销售单号=a.销售单号 and 物料编码=a.物料编码) then a.销售数量 else null end
    from 表1 a 至于重复数据,自己再用row_number排下序就可以了,有事先撤。
      

  2.   

    select * from 表1 
    union all
    select * from 表2
      

  3.   

    这个问题是要解决另外一个问题,请大家看一下这个帖子:http://topic.csdn.net/u/20081025/18/57fffa3b-40b5-4a35-af08-9ed865aec4f5.html由于交货数量存在重复,我才希望通过单独做一张发货查询表来替代原来重复的发货结果