查询:
Select
COUNT(aciklama)as Permitted,
(Select COUNT(aciklama)
from Uyari
where Aciklama like '%Blocked%') as Blocked
From
Uyari
where
Aciklama like '%Permitted%'
输出:
Permitted Blocked
----------------------
74 9194
我想要这样的结果:
Permitted ... 74
Blocked ... 9194
有人可以帮忙吗?
答案 0 :(得分:2)
这是使用union all
select 'Permitted' action, COUNT(aciklama) as result
from Uyari
where Aciklama like '%Permitted%'
union all
select 'Blocked' action, COUNT(aciklama)
from Uyari
where Aciklama like '%Blocked%'