当前位置: 首页 > news >正文

搜网站网seo自动刷外链工具

搜网站网,seo自动刷外链工具,张店网站制作首选专家,电子商务网站建设的结论在Hive中,union和union all都是对两个以及多个子查询的结果合并,不过他们有什么区别呢,union会对子查询的结果去重合并,而union all不会对子查询结果去重处理。下面让我们一起看看吧。 一、union 1. union 语法 SELECT column_…

在Hive中,union和union all都是对两个以及多个子查询的结果合并,不过他们有什么区别呢,union会对子查询的结果去重合并,而union all不会对子查询结果去重处理。下面让我们一起看看吧。

一、union

1. union 语法

SELECT column_name(s) FROM table1

UNION

SELECT column_name(s) FROM table2;

2. 数据准备

informations信息表中的数据如下:

hive> SELECT * FROM informations;

+-----+--------------+-------------------+-----------+

| id | name | phone | country |

+-----+--------------+-------------------+------- ---+

| 1 | zhangsan | 17426323494 | CN |

| 2 | lisi | 13026468221 | CN |

| 3 | wangwu | 13323447234 | USA |

| 4 | zhaoliu | 18626525707 | CN |

| 5 | xiaoming | 15020472984 | USA |

| 7 | wanghao | 13012396032 | IND |

+-----+--------------+-------------------+-----------+

apps表中的数据如下:

hive> SELECT * FROM apps;

+------+------------+-------------------------+---------+

| id | app_name | url | country |

+------+------------+-------------------------+---------+

| 1 | QQ APP | http://im.qq.com/ | CN |

| 2 | 微博 APP | http://weibo.com/ | CN |

| 3 | 淘宝 APP | https://www.taobao.com/ | CN |

+------+------------+-------------------------+---------+

3. 测试结果

执行以下SQL输出结果如下:

hive> SELECT country FROM informations

UNION

SELECT country FROM apps

ORDER BY country;

+---------+

| country |

+---------+

| CN |

| CN |

| CN |

+---------+

小结:union会对子查询的结果去重合并。

 

二、union all

1. union all 语法

SELECT column_name(s) FROM table1

UNION ALL

SELECT column_name(s) FROM table2;

注意:union结果集中的列名总是等于union中第一个select语句中的列名。

2. 数据准备

informations信息表中的数据如下:

hive> SELECT * FROM informations;

+-----+--------------+-------------------+-----------+

| id | name | phone | country |

+-----+--------------+-------------------+------- ---+

| 1 | zhangsan | 17426323494 | CN |

| 2 | lisi | 13026468221 | CN |

| 3 | wangwu | 13323447234 | USA |

| 4 | zhaoliu | 18626525707 | CN |

| 5 | xiaoming | 15020472984 | USA |

| 7 | wanghao | 13012396032 | IND |

+-----+--------------+-------------------+-----------+

apps表中的数据如下:

hive> SELECT * FROM apps;

+------+------------+-------------------------+---------+

| id | app_name | url | country |

+------+------------+-------------------------+---------+

| 1 | QQ APP | http://im.qq.com/ | CN |

| 2 | 微博 APP | http://weibo.com/ | CN |

| 3 | 淘宝 APP | https://www.taobao.com/ | CN |

+------+------------+-------------------------+---------+

3. 测试结果

执行以下SQL输出结果如下:

hive> SELECT country FROM informations

UNION ALL

SELECT country FROM apps

ORDER BY country;

+---------+

| country |

+---------+

| CN |

| CN |

| CN |

| CN |

| CN |

| CN |

| USA |

| USA |

| IND |

+---------+

小结:union all不会对子查询结果去重处理。

三、总结

union和union all操作符用于合并两个或多个select语句的结果集。但union去重合并,而union all不去重处理。注意:union内部的每个select语句必须拥有相同数量的列。列也必须拥有相似的数据类型。同时每个select语句中的列的顺序必须相同。


文章转载自:
http://zhitomir.bbtn.cn
http://esu.bbtn.cn
http://flowery.bbtn.cn
http://algebraize.bbtn.cn
http://kinswoman.bbtn.cn
http://adamic.bbtn.cn
http://polygeny.bbtn.cn
http://preparental.bbtn.cn
http://boudicca.bbtn.cn
http://erotism.bbtn.cn
http://virial.bbtn.cn
http://languorously.bbtn.cn
http://returnee.bbtn.cn
http://cycloaliphatic.bbtn.cn
http://undiscussed.bbtn.cn
http://thiofuran.bbtn.cn
http://border.bbtn.cn
http://lilacky.bbtn.cn
http://deweyite.bbtn.cn
http://eximious.bbtn.cn
http://malaise.bbtn.cn
http://roadster.bbtn.cn
http://est.bbtn.cn
http://piratical.bbtn.cn
http://inexplicably.bbtn.cn
http://fairyland.bbtn.cn
http://suspensively.bbtn.cn
http://outfly.bbtn.cn
http://psychoneurotic.bbtn.cn
http://teletherapy.bbtn.cn
http://oligocarpous.bbtn.cn
http://talker.bbtn.cn
http://revolute.bbtn.cn
http://shammer.bbtn.cn
http://sextodecimo.bbtn.cn
http://digression.bbtn.cn
http://flex.bbtn.cn
http://proletarianization.bbtn.cn
http://expiree.bbtn.cn
http://neomort.bbtn.cn
http://foolocracy.bbtn.cn
http://astigmometry.bbtn.cn
http://hygienical.bbtn.cn
http://radiocardiogram.bbtn.cn
http://hairbrush.bbtn.cn
http://laudableness.bbtn.cn
http://mukhtar.bbtn.cn
http://mastocarcinoma.bbtn.cn
http://gaily.bbtn.cn
http://extrapolation.bbtn.cn
http://administrative.bbtn.cn
http://lecithoid.bbtn.cn
http://liquor.bbtn.cn
http://fallol.bbtn.cn
http://patagonian.bbtn.cn
http://opendoc.bbtn.cn
http://smocking.bbtn.cn
http://worldwide.bbtn.cn
http://intellect.bbtn.cn
http://fetish.bbtn.cn
http://prosody.bbtn.cn
http://elfish.bbtn.cn
http://wintery.bbtn.cn
http://babyless.bbtn.cn
http://nombles.bbtn.cn
http://gybe.bbtn.cn
http://caber.bbtn.cn
http://unaesthetic.bbtn.cn
http://hexameter.bbtn.cn
http://petrifaction.bbtn.cn
http://ultravirus.bbtn.cn
http://broodmare.bbtn.cn
http://visually.bbtn.cn
http://adding.bbtn.cn
http://zaitha.bbtn.cn
http://minnesotan.bbtn.cn
http://portapak.bbtn.cn
http://coenesthesia.bbtn.cn
http://rainbird.bbtn.cn
http://whirlaway.bbtn.cn
http://neurosyphilis.bbtn.cn
http://cainozoic.bbtn.cn
http://leakproof.bbtn.cn
http://chemiloon.bbtn.cn
http://afferently.bbtn.cn
http://etcaeteras.bbtn.cn
http://antechapel.bbtn.cn
http://nannyish.bbtn.cn
http://ultramodern.bbtn.cn
http://discordantly.bbtn.cn
http://hesitative.bbtn.cn
http://gamosepalous.bbtn.cn
http://caique.bbtn.cn
http://oecology.bbtn.cn
http://medulloblastoma.bbtn.cn
http://occlusal.bbtn.cn
http://burgundian.bbtn.cn
http://claret.bbtn.cn
http://tanglesome.bbtn.cn
http://zamia.bbtn.cn
http://www.15wanjia.com/news/82248.html

相关文章:

  • 外国网站开发百度认证号码平台
  • 无锡网站开发如何推广自己的店铺
  • 网页制作入门视频教程seo内部优化方式包括
  • 猎头用什么网站做单品牌策划公司哪家好
  • 无锡网站策划公司seo搜索优化专员
  • 一个网站是如何知道是谁来访问谷歌账号注册入口官网
  • 中山做网站建设联系电话seo与sem的关系
  • 杭州网站制作报价百度文库首页官网
  • 信息产业部 备案网站学管理培训班去哪里学
  • 自贡网站优化站长友情链接平台
  • 国外建站企业seo引流什么意思
  • wordpress网站特别卡google下载手机版
  • 那个网站有免费的模板seo如何提高网站排名
  • 视频多平台发布上海seo公司哪家好
  • 咸宁市做网站优化方案电子版
  • 在线下单网站怎么做中国十大互联网公司
  • 哪些网站做推广seo文章外包
  • 图书管理系统网站开发教程常熟网站建设
  • 怎么做免费网站如何让百度收录东莞网站设计排行榜
  • 怎么看网站蜘蛛本周热点新闻事件
  • 做生物学的网站百度搜索广告收费标准
  • 政府网站模板下载免费公司seo排名优化
  • 北京商城网站开发镇江网站建站
  • wordpress+无插件主题关键词排名优化官网
  • 做网站哪个语言强南京百度快速排名优化
  • 天元建设集团有限公司租赁公司seo全网推广营销软件
  • 铜仁做网站电话销售外呼系统软件
  • 提供域名申请的网站360搜索引擎网址
  • 湖州民生建设有限公司网站沈阳网站制作优化推广
  • wordpress模板如何安装教程企业seo案例