Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LeetCode SQL 50 #23

Answered by iamAntimPal
IamShiwangi asked this question in Q&A
Discussion options

You must be logged in to vote
SELECT e1.employee_id
FROM
 Employees AS e1
 LEFT JOIN Employees AS e2 ON e1.manager_id = e2.employee_id
WHERE e1.salary < 30000 
 AND e1.manager_id IS NOT NULL 
 AND e2.employee_id IS NULL
ORDER BY 1;

for explanation click on me

Replies: 1 comment 1 reply

Comment options

SELECT e1.employee_id
FROM
 Employees AS e1
 LEFT JOIN Employees AS e2 ON e1.manager_id = e2.employee_id
WHERE e1.salary < 30000 
 AND e1.manager_id IS NOT NULL 
 AND e2.employee_id IS NULL
ORDER BY 1;

for explanation click on me

You must be logged in to vote
1 reply
Comment options

Thank you sir

Answer selected by IamShiwangi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /