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??

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3de51-2bc18.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3de51-2bc18.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?