当前位置:网站首页>【组队学习】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内核浏览器。
边栏推荐
- The more AI evolves, the more it resembles the human brain! Meta found the "prefrontal cortex" of the machine. AI scholars and neuroscientists were surprised
- Is it safe to open an online stock account?
- Perfect shuffle problem
- A new generation of cascadable Ethernet Remote i/o data acquisition module
- Do you really need automated testing?
- 一文搞懂php中的(DI)依赖注入
- TensorFlow,危!抛弃者正是谷歌自己
- Comprehensive assignment of thesis writing instruction of Dongcai
- Redis related-03
- 腾讯开源项目「应龙」成Apache顶级项目:前身长期服务微信支付,能hold住百万亿级数据流处理...
猜你喜欢
ICML 2022 | 字节跳动 AI Lab 提出多模态模型:X-VLM,学习视觉和语言的多粒度对齐...
完美洗牌问题
Lu Qi invests in quantum computing for the first time
马斯克:推特要学习微信,让10亿人「活在上面」成为超级APP
zabbix的安装避坑指南
MySQL根据表前缀批量修改、删除表
西电AI专业排名超清北,南大蝉联全国第一 | 2022软科中国大学专业排名
Tensorflow, danger! Google itself is the one who abandoned it
协作+安全+存储,云盒子助力深圳爱德泰重构数据中心
Mstp+vrrp+ospf implements a three-tier architecture
随机推荐
Easynvr fails to use onvif to detect the device. What is the reason why "no data" is displayed?
Is it safe to open an account on the compass? Is it reliable?
【Rust投稿】从零实现消息中间件(6)-CLIENT
【Harmony OS】【ARK UI】ETS 上下文基本操作
指南针在上面开户安全吗?靠谱吗?
教你如何在winpe里安装win11系统
华为上诉失败,被禁止在瑞典销售 5G 设备;苹果公司市值重获全球第一;Deno 完成 2100 万美元 A 轮融资|极客头条
Peking University has a new president! Gongqihuang, academician of the Chinese Academy of Sciences, took over and was admitted to the Physics Department of Peking University at the age of 15
Solution to the problem that Linux crontab timed operation Oracle does not execute (crontab environment variable problem)
Tencent's open source project "Yinglong" has become a top-level project of Apache: the former long-term service wechat payment can hold a million billion level of data stream processing
完美洗牌问题
程序猿职业发展9项必备软技能
Nacos practice record
redis
网上开户股票安全吗?怎么开户呢?
PHP uses getid3 to obtain the duration of MP3, MP4, WAV and other media files
Lu Qi invests in quantum computing for the first time
用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
Tencent Open Source Project "Yinglong" est devenu un projet Apache de haut niveau: l'ancien Service à long terme Wechat payment, peut maintenir un million de milliards de niveaux de traitement de flux
Preparedstatement principle of preventing SQL injection