troubleshooting Question

Having trouble with the COUNT function in SQL (Microsoft Access)

Avatar of nocturn4l
nocturn4l asked on
Microsoft AccessSQL
2 Comments1 Solution512 ViewsLast Modified:
Microsoft Access 2003

Tables
Teacher = [CourseN, Quarter,TeacherName]
Course = [Course N Quarter , DayTime,  Room #]/ Examples of DayTime: M 2:00,
W 4:50, and T 8:00.
Student = [studentName,Course #, Quarter]

^The underlined words are the primary keys

I want to be able to list the student name that took the most courses.. but I'm having trouble coming up with the correct syntax

SELECT A.studentName
FROM Student A
WHERE (SELECT COUNT(CourseN)
FROM Student B
WHERE COUNT(CourseN)) > ......something here


or If I wanted to list every course number and the student's name who has taken the same course twice... I have something like:

SELECT A.studentName
FROM Student AS A
GROUP BY A.studentName
HAVING Count(CourseN)>2;

but that's coming up wrong too..

any help would be appreciated, thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros