SELECT COUNT(*) SQL SERVER
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.
SELECT count(distinct AssignmentID)
FROM ProblemView
精彩评论