sql row value wise count

Query:

 SELECT   COUNT(CASE WHEN DayStatusID = 1 THEN 1 END) AS A,  
             COUNT(CASE WHEN DayStatusID = 7 THEN 1 END) AS B,  
             COUNT(CASE WHEN DayStatusID = 3 THEN 1 END) AS C  
 from Payroll_tblYearMonthDayEntry  

Result:


Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report