开发者

SELECT COUNT(*) SQL SERVER

开发者 https://www.devze.com 2023-02-02 15:32 出处:网络
I have this: SELECT AssignmentID FROM ProblemView GROUP BY AssignmentID which returns 32 rows. But really what I want is the number 32.

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 
0

精彩评论

暂无评论...
验证码 换一张
取 消