select count(present)from attendance where present='true'
Group By
SELECT Emp_Name, COUNT(Present) FROM ATTENDANCE WHERE Present = 'true' GROUP BY Emp_Name
SELECT Emp_Name, SUM(CASE WHEN present = 'True' THEN 1 ELSE 0 END) AS [Present Count], SUM(CASE WHEN present = 'False' THEN 1 ELSE 0 END) AS [Absent Count] from attendance GROUP BY Emp_Name
SELECT Emp_Name AS Name ,COUNT(present) AS Cnt FROM tableName WHERE present = 'true' GROUP BY Emp_Name ORDER BY Name;
SELECT Emp_Name, count(present) FROM tableName WHERE present = 'true' GROUP BY Emp_Name
select Employee_name, count(present) as total_employee from attendance where present='true' Group By Employee_name
select A.Emp_Name, case when Count(A.Present) in (select Count(Present) from attendence where Present in ('false') group by Emp_Name) then 0 else (select Count(B.Present) from attendence B where A.Emp_Name = B.Emp_Name and B.Present in ('true') group by Emp_Name) End Present from attendence A where Present in ('true','false') group by Emp_Name
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)