?
Solved

Help with MS SQL views.

Posted on 2007-03-30
3
Medium Priority
?
187 Views
Last Modified: 2010-03-19
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.
0
Comment
Question by:eivo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:Sham Haque
ID: 18822164
select userid
from courses
having count(*) > 10
0
 
LVL 18

Accepted Solution

by:
Sham Haque earned 150 total points
ID: 18822167
sorry:

select userid
from courses
having count(*) >= 10
group by userif
0
 
LVL 4

Author Comment

by:eivo
ID: 18822191
Group by and having should be the other way round (I Think)
0

Featured Post

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question