I would like to ask you mssql how to query the same type of primary, intermediate, senior, super room a total of how many people?

there are two fields in my online user list, namely userID (user id) and Wid (room id).
). Now count the total number of people in the same type of primary, intermediate, advanced and super rooms.
I can get the number of people in each room after grouping through group, but I can"t integrate it further

select COUNT (UserID), wid from dbo.ViewOnlineUsers group by WID

want to get, for example, a total of 50 people in the primary, intermediate and advanced fields of two Niuniu, in one field.

Apr.07,2021

cover a select sum


right. Then why do you want group by??

Menu