3

Query:

Select 
    COUNT(aciklama)as Permitted,   
    (Select COUNT(aciklama) 
     from Uyari 
     where Aciklama like '%Blocked%') as Blocked 
From 
    Uyari 
where 
    Aciklama like '%Permitted%'

Output:

Permitted     Blocked
----------------------
    74         9194

I want result like this:

Permitted   ...      74
Blocked    ...     9194  

Could any one help?

hello_there_andy
  • 2,039
  • 2
  • 21
  • 51

1 Answers1

2

Here's one option using 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%'
sgeddes
  • 62,311
  • 6
  • 61
  • 83