当前位置:网站首页>【组队学习】SQL编程语言笔记——Task04
【组队学习】SQL编程语言笔记——Task04
2022-06-25 03:43:00 【游戏编程】

先看总体,Task04的知识点主要是表的加减法和连结

1.表的加减法
1.1 什么是集合运算?首先表、视图和查询的执行结果都是 记录的集合 ,加减法和运算同理。
集合的基本运算:交集、并集、差集、补集、对称差集、超集、子集。
1.2 【UNION】加法/并集
需要注意的是:UNION 等集合运算符通常都会除去 重复的记录 ,如果不需要除去重复记录只需要在 UNION 后面添加 ALL 关键字就可以了
1.3 UNION 与 OR 谓词
学习文档里我自己看起来不太理解,就百度了一下:https://zhidao.baidu.com/question/429077726.html 链接送上了,如果有依然不理解的建议自行了解清楚哈,总结我通过文章的理解:UNION拿到数据会整理好给我们,OR不会,那你希望拿到的数据是如何就选择用哪个。
1.4 隐式数据类型转换
注意事项:hive中进行join关联时,关联列要避免使用隐式数据类型转换,否则容易导致数据倾斜
附上链接:https://zhuanlan.zhihu.com/p/447472435 更建议自行百度
1.5 【INTERSECT】交集
MySQL 8.0 不支持交集运算INTERSECT,需要用 inner join 来求得交集
1.6 【EXCEPT】交集
MySQL 8.0 不支持减法 EXCEPT 运算,可以借助学过的NOT IN 谓词
1.7 对称差:两个集合的交可以看作是两个集合的并去掉两个集合的对称差

2.连结
2.1 内连结
2.2 外连结
2.3多表连结
作者:不⃰说⃰再⃰见⃰
游戏编程,一个游戏开发收藏夹~
如果图片长时间未显示,请使用Chrome内核浏览器。
边栏推荐
- Redis related-01
- 在华泰证券上面开股票账户好不好,安不安全?
- Oracle-sqlload import external data details
- 現在,耳朵也要進入元宇宙了
- Skywalking implements cross thread trace delivery
- Jilin University 22 spring March "official document writing" assignment assessment-00084
- The problem that only the home page can be accessed under openSUSE Apache laravel
- 【Rust投稿】捋捋 Rust 中的 impl Trait 和 dyn Trait
- Void* pointer
- TCC mode explanation and code implementation of Seata's four modes
猜你喜欢

Internet Explorer died, and netizens started to build a true tombstone

zabbix的安装避坑指南

Maybe it's the wrong reason

What is an SSL certificate and what are the benefits of having an SSL certificate?

北大换新校长!中国科学院院士龚旗煌接任,15岁考上北大物理系

IE寿终正寝,网友们搞起了真·墓碑……

(超详细onenet TCP协议接入)arduino+esp8266-01s接入物联网平台,上传实时采集数据/TCP透传(以及lua脚本如何获取和编写

Mobile mall project operation

Copilot免费时代结束!正式版67元/月,学生党和热门开源项目维护者可白嫖

西电AI专业排名超清北,南大蝉联全国第一 | 2022软科中国大学专业排名
随机推荐
x86 CPU,危!最新漏洞引发热议,黑客可远程窃取密钥,英特尔“全部处理器”受影响...
股票在网上开户安全吗?在线等答案
Sleep more, you can lose weight. According to the latest research from the University of Chicago, sleeping more than 1 hour a day is equivalent to eating less than one fried chicken leg
Do you really need automated testing?
Is it safe to open a stock account on Huatai Securities?
OpenSUSE installation pit log
TensorFlow,危!抛弃者正是谷歌自己
同花顺证券开户是安全的吗?
About sizeof() and strlen in array
Install ffmpeg in LNMP environment and use it in yii2
TC object structure and abbreviation
The file attributes downloaded by the browser are protected. How to remove them
【Rust投稿】捋捋 Rust 中的 impl Trait 和 dyn Trait
zabbix的安装避坑指南
Maybe it's the wrong reason
签到功能完成03《ivx低代码签到系统制作》
Svn deployment
同花顺证券开户安全吗
MySQL modifies and deletes tables in batches according to the table prefix
Randla net: efficient semantic segmentation of large scale point clouds