Luke Pope
asked on
SQL Code help
Here is question. Here is SQL Im not getting it right.
SELECT a.AdvisorID, a.LastName, a.FirstName, COUNT( s.StudentID ) AS "COUNT(Students)"
FROM Advisors a
JOIN Students s
ON a.AdvisorID = s.AdvisorID
GROUP BY a.AdvisorID
HAVING COUNT(s.StudentID)='1';
SELECT a.AdvisorID, a.LastName, a.FirstName, COUNT( s.StudentID ) AS "COUNT(Students)"
FROM Advisors a
JOIN Students s
ON a.AdvisorID = s.AdvisorID
GROUP BY a.AdvisorID
HAVING COUNT(s.StudentID)='1';
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
@HuaMinChen
Why did you change the original query to >= 1 ?? There is no apparent reason to do this
Why did you change the original query to >= 1 ?? There is no apparent reason to do this
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Lol
I was attempting an explanation of basic syntax. Now it fast forwards to advanced performance options....
I was attempting an explanation of basic syntax. Now it fast forwards to advanced performance options....
Hi Luke,
Is this resolved? Please advise.
Is this resolved? Please advise.
Open in new window