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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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