Python全系列 教程
3567个小节阅读:5928.9k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
内连接
只有进行连接的两张表的数据都存在连接条件相匹配时才会查询出来。
xxxxxxxxxx
hive> select e.empno,e.ename,d.dname from emp e join dept d on e.deptno=d.deptno;
Query ID = root_20211118102413_dda90f63-c584-4d88-997c-318ddfd18b6b
Total jobs = 1
7369 smith research
7499 allen sales
7521 ward sales
7566 jones research
7654 martin sales
7698 blake sales
7782 clark accounting
7788 scott research
7839 king accounting
7844 turner sales
7876 adams research
7900 james sales
7902 ford research
7934 miller accounting
右外连接
右外连接:join关键字右边的表所有的记录都会返回。
xxxxxxxxxx
hive>select e.empno,e.ename,d.dname from emp e right join dept d on e.deptno=d.deptno;
7782 clark accounting
7839 king accounting
7934 miller accounting
7369 smith research
7566 jones research
7788 scott research
7876 adams research
7902 ford research
7499 allen sales
7521 ward sales
7654 martin sales
7698 blake sales
7844 turner sales
7900 james sales
NULL NULL operations #使用null替代
左外连接
左外连接:join关键字左边的表所有的记录都会返回。
xxxxxxxxxx
hive>select e.empno,e.ename,d.dname from emp e left join dept d on e.deptno=d.deptno;
全外连接
xxxxxxxxxx
hive>select e.empno,e.ename,d.dname from emp e full join dept d on e.deptno=d.deptno;
第一部分:两张有对应关联关系数据。
第二部分:左表中在右边表找不到匹配的数据。
第三部分:右表中在左边表找不到匹配的数据