9

I have this:

SELECT AssignmentID
FROM ProblemView
GROUP BY AssignmentID

which returns 32 rows. But really what I want is the number 32. If I do this:

SELECT COUNT(*)
FROM lru.ProblemView
GROUP BY AssignmentID

I still get 32 rows, and the column is merely the count of the number of Assignments per problem.

I just need the number 32.

1 Answer 1

18
SELECT count(distinct AssignmentID) 
FROM ProblemView 
Sign up to request clarification or add additional context in comments.

1 Comment

Sheesh. When am I ever going to learn SQL Server? Thank you very much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.