How to get percentages of maximum counts?

SELECT TeamName, Count(TeamName) AS Count
FROM table
GROUP BY TeamName

You need to use the Count Function – To count the team name

And you need to use group by to determine how you want the counts to be grouped

Edited Answer.

SELECT TeamName, 
       Count(DISTINCT CASE WHEN WorkInfo = 1 
                           THEN SlNo end) AS Count1 , 
       Count(DISTINCT CASE WHEN WorkInfo = 0 
                           THEN SlNo end) AS Count0 
FROM tableA 
GROUP BY TeamName

Browse More Popular Posts

Leave a Comment