SQL-Employees Earning More Than Their Managers

思路:
今天复习数据库突然想起来leetcode上数据库的题目,就找来做了
(1)给表取别名
格式见code,这在自身连接的时候是很有必要的
(2)自身连接
from语句后面相当于接了“一张表”,如果是多个表,就相当于形成了他们的笛卡尔积
然后通过where语句选择出所需要的行,通过头上的select语句选出相应的列
# Write your MySQL query statement below
select a.Name from Employee as a,Employee as b
where a.ManagerId = b.Id and a.Salary > b.Salary
SQL-Employees Earning More Than Their Managers的更多相关文章
- LeetCode SQL:Employees Earning More Than Their Managers
# Write your MySQL query statement below SELECT a.Name FROM Employee AS a INNER JOIN Employee AS b O ...
- [SQL]LeetCode181. 超过经理收入的员工 | Employees Earning More Than Their Managers
SQL架构 Create table If Not Exists Employee (Id ), Salary int, ManagerId int) Truncate table Employee ...
- 【SQL】181. Employees Earning More Than Their Managers
The Employee table holds all employees including their managers. Every employee has an Id, and there ...
- [LeetCode] Employees Earning More Than Their Managers 员工挣得比经理多
The Employee table holds all employees including their managers. Every employee has an Id, and there ...
- LeeCode(Database)-Employees Earning More Than Their Managers
The Employee table holds all employees including their managers. Every employee has an Id, and there ...
- Leetcode 181. Employees Earning More Than Their Managers
The Employee table holds all employees including their managers. Every employee has an Id, and there ...
- LeetCode - Employees Earning More Than Their Managers
Description: The Employee table holds all employees including their managers. Every employee has an ...
- 181. Employees Earning More Than Their Managers
The Employee table holds all employees including their managers. Every employee has an Id, and there ...
- DataBase -- Employees Earning More Than Their Managers My Submissions Question
Question: The Employee table holds all employees including their managers. Every employee has an Id, ...
- Employees Earning More Than Their Managers
The Employee table holds all employees including their managers. Every employee has an Id, and there ...
随机推荐
- 国内三大PT(Private Tracker)站分析
除这一行外,下面全部内容都是转载.出处不明. 国内三大PT(Private Tracker)站分析 先郑重的声明一下:本文以下的内容所有是复制粘贴的,不代表老夫的观点. 事实上内容我也没细致看. 贴这 ...
- Java基础知识强化91:DateFormat类之DateFormat实现日期和字符串的相互转换
1. DateFormat类概述: DateFormat 是日期/时间格式化子类的抽象类,它以与语言无关的方式格式化并解析日期或时间. 是抽象类,所以使用其子类SimpleDateFormat 2. ...
- (转)jquery.validator规则
登录|注册 收藏成功 确定 收藏失败,请重新收藏 确定 标题 标题不能为空 网址 标签 摘要 公开 取消收藏 分享资讯 传PPT/文档 提问题 写博客 传资源 ...
- Linux误删C基本运行库libc.so.6急救方法
首先普及一下关于libc.so.6的基本常识: libc.so.6是glibc的软链接 ll /lib64/libc.so.6lrwxrwxrwx 1 root root 11 Aug 27 201 ...
- Cacti监控Windows主机,Windows主机的正确配置
使用cacti监控Windows主机的时候经常遇到无法获取Windows主机的snmp信息和Windows主机的硬件信息,主要原因是Windows主机没有正确配置snmp,以下是正确的配置步骤:1.安 ...
- 有用的前端demo
js定时器循环切换字体和背景颜色<script type="text/javascript"> var flashId = 0; setInterval(functio ...
- Caused by: java.lang.NullPointerException, java.lang.reflect.InvocationTargetExc
java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M ...
- 关于操作DC时的资源泄露
首先应明确一个概念 句柄, 关于句柄的详细介绍请见这里 对于句柄的使用小结:借来的要归还,创建的要释放,选出的要选入[尤其是针对GDI的一些句柄而言,如HPEN,HBRUSH等] 1. 使用GetDC ...
- ajax提交表单序列化(serialize())数据
知识点: $("#form").serialize();将表单数据序列化为标准URL编码文本字符串(key1=value1&key2=value2…). 以下用一个例子来演 ...
- datagrid公用字段扩展
easyui 1.3.5扩展 datagrid 控件 扩展公用段 把 (9082行) var opts = $.data(_698,"datagrid").options; 改成 ...