我需要显示特定名称的当前状态计数
Select count(*) from employees where status='Present';
此查询返回整个当前计数。我该怎么做才能获得特定名称的状态?
答案 0 :(得分:2)
select status, count(*)
from employees
group by status
或
select name, count(*)
from employees
where status = 'Present'
group by name
答案 1 :(得分:0)
试试这个:
select name, count(*)
from employees
where name = 'abc' and
status = 'Present';
分享并享受。
答案 2 :(得分:-1)
从员工中选择count(1),其中status ='Present'group by name