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

How are these two codes different from each other. Although the result is same. #10

Unanswered
Purushotham-m16 asked this question in Q&A
Discussion options

I am trying to extract name of employee who is reported by 5 or more employees on leetcode:

Accepted code:
SELECT
EMP1.name
FROM Employee AS EMP1
JOIN(
SELECT managerId
FROM Employee
GROUP BY managerId
HAVING COUNT(managerId) >= 5
) AS EMP2
ON EMP1.id = EMP2.managerId

Rejected code:
SELECT name
FROM Employee
HAVING COUNT(managerId) >= 5

You must be logged in to vote

Replies: 0 comments

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

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