Help with MS SQL views.

Hi
I have a table in Microsoft SQL Server 2000 that contains information on a set of courses done by a group of individuals. basically when an individual completes a course, their userID and the courseID is added to this table, essensially creating a list of every completed course.

what I would like to do, is create a view where I could see a list of all userIDs that have completed say 10 courses in total (therefore have 10 records on the completed course table to their name)

can anyone help? i'm having a mental block on SQL today..

Many thanks.
LVL 4
eivoAsked:
Who is Participating?
 
Sham HaqueSenior SAP CRM ConsultantCommented:
sorry:

select userid
from courses
having count(*) >= 10
group by userif
0
 
Sham HaqueSenior SAP CRM ConsultantCommented:
select userid
from courses
having count(*) > 10
0
 
eivoAuthor Commented:
Group by and having should be the other way round (I Think)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.