当前位置:网站首页>Oracle subquery
Oracle subquery
2022-06-29 08:32:00 【Mr. Li, a prodigy】
If a worker wants to do a good job, he must sharpen his tools first
Articles are constantly updated , You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .

List of articles
- One 、 Subquery
- 1、 Query the information of the youngest student
- 2、 Query age and “ Zhang San ” Student information of the same size
- 3、 Check age , Gender and “ Zhang San ” The same student information , barring “ Zhang San ”
- 4、 Query age and “ Zhang San ” perhaps “ Li Si ” Same student information
- 5、 If there is a name “ Zhang San ” Of the students , Then find out all the student information , If no name is “ Zhang San ” Of the students , Just don't query anything
- Two 、 stay having Use subqueries in
- 3、 ... and 、 stay from Clause using subqueries
- Four 、 summary
One 、 Subquery
exists(): Judge , If the subquery returns data , Then execute the external query
1、 Query the information of the youngest student
select * from student where age = (select min(age) from student);
2、 Query age and “ Zhang San ” Student information of the same size
select * from student where age = (select age from student where name = ' Zhang San ')
3、 Check age , Gender and “ Zhang San ” The same student information , barring “ Zhang San ”
select * from student where (age,sex) = (select age,sex from student where name = ' Zhang San ')
and name <> ' Zhang San '
4、 Query age and “ Zhang San ” perhaps “ Li Si ” Same student information
select * from student where age in (select age from student where name =' Zhang San ' or ' Li Si ')
5、 If there is a name “ Zhang San ” Of the students , Then find out all the student information , If no name is “ Zhang San ” Of the students , Just don't query anything
select * from student where exists(select * from student where name = ' Zhang San ')
Two 、 stay having Use subqueries in
1、 Find out the classes whose class average score is higher than the grade average score 、 average 、 Class size
select class,count(*),avg(grade) from student group by class having avg(grade) > (select avg(grade) from student)
3、 ... and 、 stay from Clause using subqueries
1、 Ask the students id After class grouping with the teacher sid Equal student id
select s.id from student s (select t.id,t.class from teacher t group by t.class) where s.id = t.sid
Four 、 summary
The relevant contents here have not been sorted out yet , The article continues to be updated later , Recommended collection .
The commands involved in the article must be typed several times each like me , Only in the process of knocking can you find out whether you really master the command .
You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .
边栏推荐
- Want to open a stock account, is it safe to open a stock account online-
- P6772 [NOI2020] 美食家(矩阵快速幂)
- Notice on organizing the second round of the Northwest Division (Shaanxi) of the 2021-2022 National Youth electronic information intelligent innovation competition
- U盘内存卡数据丢失怎么恢复,这样操作也可以
- 《动手学深度学习》(一)-- 线性神经网络
- [6G] collation of white paper on computing network technology
- 征文投稿丨使用轻量应用服务器搭建博客环境
- 智能硬件evt dvt pvt mp
- STM32基于HAL库的USART+DMA使用
- Blueprint basis
猜你喜欢

Segment tree and use

实战回忆录:从Webshell开始突破边界

Seven common sorts

华为设备配置小型网络WLAN基本业务

Friends, static keywords, static methods, and relationships between objects
![[6G] collation of white paper on computing network technology](/img/a3/8e60eef55ebcd91fa6188722c87a70.png)
[6G] collation of white paper on computing network technology
![[domain penetration authorization] cve-2020-1472 Netlogon privilege escalation vulnerability](/img/1a/916915b32e5adaf86b210fc764dbf6.png)
[domain penetration authorization] cve-2020-1472 Netlogon privilege escalation vulnerability

SQL Server enable CDC

新版付费塔罗牌测算源码 (附带搭建教程)

壁纸小程序源码双端微信抖音小程序
随机推荐
A review of visual SLAM methods for autonomous driving vehicles
What does Ali's 211 mean?
Development trend of garment industry | supply chain | intelligent manufacturing
Simple use of AWS elastic Beanstalk
PHP 7.1.13 版本,在使用过程中发现 浮点类型 数据经过 json_encode 之后会出现精度问题
[6G] collation of white paper on computing network technology
壁纸小程序源码双端微信抖音小程序
P6772 [NOI2020] 美食家(矩阵快速幂)
In PHP version 7.1.13, it is found that floating-point data passes through JSON during use_ There will be precision problems after encode
About the many to many cascading insertion of sqlsugar (the ID of the collection attribute cannot be obtained, so the intermediate table cannot be maintained)
MySQL statistics by day / week / month / quarter / half year / year
Speech signal processing - Fundamentals (I): basic acoustic knowledge
Segment tree and use
表格背单词的方法
华为设备配置小型网络WLAN基本业务
aws iam内联策略示例
Summary of various series (harmonic, geometric)
Paddlenlp general information extraction model: UIE [information extraction {entity relationship extraction, Chinese word segmentation, accurate entity markers, emotion analysis, etc.}, text error cor
1284_ Implementation analysis of FreeRTOS task priority acquisition
Voice annotation automatic segment alignment tool sppas usage notes