永发信息网

【unionall】...内容无重叠用selectunion和selectunionall查询...

答案:2  悬赏:40  手机版
解决时间 2021-01-30 09:11
  • 提问者网友:不爱我么
  • 2021-01-30 02:03
【unionall】...内容无重叠用selectunion和selectunionall查询...
最佳答案
  • 五星知识达人网友:青灯有味
  • 2021-01-30 02:16
【答案】 内容无重叠如何解释
  
  union 会自动筛选重复数据,这个重复不论是在a表中重复的,还是a、b两个表的记录重复的,都会筛选掉.效果相当于distincdt
  union all则会返回所有记录
  
  举例:
  A表数据
  1
  2
  B表数据
  3
  4
  
  select * from a union select * from b 结果
  1
  2
  3
  4
  
  select * from a union all slect * from b 结果同上
  
  
  
  
  A表数据
  1
  2
  B表数据
  2
  4
  
  select * from a union select * from b 结果
  1
  2
  4
  
  select * from a union all slect * from b 结果
  1
  2
  2
  4
全部回答
  • 1楼网友:低音帝王
  • 2021-01-30 03:02
谢谢了
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯