当前位置:网站首页>子连接中的参数传递
子连接中的参数传递
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之间字段显示列
简单图片解释如下:

边栏推荐
- 【七夕快乐篇】Nacos是如何实现服务注册功能的?
- Implementation principle of golang coroutine
- 365天深度学习训练营-学习线路
- .net (C#) get year month day between two dates
- [CVA Valuation Training Camp] Financial Modeling Guide - Lecture 1
- 3年,从3K涨薪到20k?真是麻雀啄了牛屁股 — 雀食牛逼呀
- [Cloud Native--Kubernetes] Pod Controller
- 2022年华数杯数学建模
- The master teaches you the 3D real-time character production process, the game modeling process sharing
- uniapp sharing function - share to friends group chat circle of friends effect (sorting)
猜你喜欢

Basic web in PLSQL

小黑leetcode冲浪:94. 二叉树的中序遍历
![情侣牵手[贪心 & 抽象]](/img/7d/1cafc000dc58f1c5e2e92150be7953.png)
情侣牵手[贪心 & 抽象]

Essential knowledge for entry-level 3D game modelers

深度|医疗行业勒索病毒防治解决方案

MongoDB permission verification is turned on and mongoose database configuration

uniapp sharing function - share to friends group chat circle of friends effect (sorting)

Ab3d.PowerToys and Ab3d.DXEngine Crack

NebulaGraph v3.2.0 Release Note, many optimizations such as the performance of querying the shortest path

Senior game modelers tell newbies, what are the necessary software for game scene modelers?
随机推荐
"Relish Podcast" #397 The factory manager is here: How to use technology to empower the law?
Cloud native - Kubernetes 】 【 scheduling constraints
10 个关于 Promise 和 setTimeout 知识的面试题,通过图解一次说透彻
407. 接雨水 II
Bidding Announcement | Operation and Maintenance Project of Haina Baichuang Official Account
容联云发送短信验证码
uniapp动态实现滑动导航效果demo(整理)
Nuclei (2) Advanced - In-depth understanding of workflows, Matchers and Extractors
Implementation principle of golang coroutine
MySQL基础篇【聚合函数】
七牛云图片上传
.net(C#)获取两个日期间隔的年月日
365天深度学习训练营-学习线路
[LeetCode] Summary of Matrix Simulation Related Topics
加解密在线工具和进制转化在线工具
[Cloud Native--Kubernetes] Pod Controller
动态上传jar包热部署
Develop a SpaceX website based on the Appian low-code platform
为何越来越多人选择进入软件测试行业?深度剖析软件测试的优势...
How to burn the KT148A voice chip into the chip through the serial port and the tools on the computer