[SQL] 不合并重复数据 union all

发布于:2016年06月14日 已被阅读

select   *   from   A   
  union     
  select   *   from   B   
    
    
    
  --不合并重复行   
  select   *   from   A   
  union   all   
  select   *   from   B   
    
    
  --如果要对字段进行排序   
  select   *   
  from   (   
  select   id,...   from   A   
  union   all   
  select   id,...   from   B   
  )   t   
  order   by   ID