0705 sql

looggi·2023년 7월 4일
0

TILs

목록 보기
112/114
post-thumbnail

181. Employees Earning More Than Their Managers

-- https://leetcode.com/problems/employees-earning-more-than-their-managers/submissions/986199313/

select e.name as employee
from employee e, employee ee
where e.managerid= ee.id and e.salary> ee.salary

JOIN 하는 게 더 느릴 것 같았는데 더 빠른가봄?

select e1.name as Employee
from Employee e1
left join Employee e2
on e1.managerId = e2.id
where e1.salary > e2.salary

182. Duplicate Emails

select email
from person
group by email
having count(*)>1
profile
looooggi

0개의 댓글