当前位置:网站首页>子连接中的参数传递
子连接中的参数传递
2022-08-04 23:50:00 【赟文武】
列出薪水高于所有所在部门平均工资的员工信息
select deptno,ename,sal from emp a where sal>(select avg(sal) from emp where deptno=a.deptno);
我们先把子句中的where子句去掉,该语句变成如下格式:
select deptno,ename,sal from emp a where sal>(select avg(sal) from emp);
该语句很好理解即求薪水高于所有员工的平均工资的员工信息,执行效果如下:
执行顺序可做如下理解:
- 首先确定表对象emp
- 根据where后条件进行筛选,先执行()内的将()内的看作一个值比较
- 根据select…from中间的东西显示列
在其中加入where语句与外部deptno进行了一个数据限制
select deptno,ename,sal from emp a where sal>(select avg(sal) from emp where deptno=a.deptno);
执行顺序如下:
- 首先执行from确定表对象,
- 根据where条件对数据进行逐行筛选(从外部向内部传入了一个数据)
- 根据select…from之间字段显示列
简单图片解释如下:

边栏推荐
- @Import注解的作用以及如何使用
- Literature reading ten - Detect Rumors on Twitter by Promoting Information Campaigns with Generative Adversarial Learn
- [CVA Valuation Training Camp] Financial Modeling Guide - Lecture 1
- LeetCode Hot 100
- The role of the annotation @ EnableAutoConfiguration and how to use
- 【LeetCode】双指针题解汇总
- npm基本操作及命令详解
- OPENCV学习DAY8
- "Relish Podcast" #397 The factory manager is here: How to use technology to empower the law?
- what is MVCC
猜你喜欢
![[LeetCode] Summary of Matrix Simulation Related Topics](/img/80/bd71ca5211cce5805909015a642893.jpg)
[LeetCode] Summary of Matrix Simulation Related Topics

仿网易云音乐小程序-uniapp

【SSR服务端渲染+CSR客户端渲染+post请求+get请求+总结】

【手撕AHB-APB Bridge】~ AMBA总线 之 AHB

Nuclei (2) Advanced - In-depth understanding of workflows, Matchers and Extractors

OPENCV学习DAY8

Xiaohei's leetcode journey: 95. Longest substring with at least K repeating characters

How to burn the KT148A voice chip into the chip through the serial port and the tools on the computer

Basic web in PLSQL

使用OpenCV实现一个文档自动扫描仪
随机推荐
Ab3d.PowerToys and Ab3d.DXEngine Crack
KT148A voice chip ic working principle and internal architecture description of the chip
Statistical words (DAY 101) Huazhong University of Science and Technology postgraduate examination questions
吐槽 | 参加IT培训的正确姿势
.net (C#) get year month day between two dates
NebulaGraph v3.2.0 Release Note, many optimizations such as the performance of querying the shortest path
Privacy Computing Overview
d枚举生成位
大师教你3D实时角色制作流程,游戏建模流程分享
Essential knowledge for entry-level 3D game modelers
为何越来越多人选择进入软件测试行业?深度剖析软件测试的优势...
统计单词(DAY 101)华中科技大学考研机试题
【LeetCode】图解 904. 水果成篮
隐私计算综述
10 个关于 Promise 和 setTimeout 知识的面试题,通过图解一次说透彻
游戏3D建模入门,有哪些建模软件可以选择?
Chinese and Japanese color style
[LeetCode] Summary of Matrix Simulation Related Topics
Senior game modelers tell newbies, what are the necessary software for game scene modelers?
Xiaohei's leetcode journey: 95. Longest substring with at least K repeating characters