declare @tablename table (servicetype varchar(255)) inse...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

declare  @tablename table (servicetype varchar(255))
insert into @tablename
values ('ADSL-1M') 	
,('ADSL-4M')
,('VDSL-15M') 	
,('VDSL-25M') 	
,('FTTH-4M') 	

SELECT Count(CASE 
               WHEN servicetype LIKE '%ADSL%' THEN 1 
               ELSE NULL 
             END) AS ADSL, 
       Count(CASE 
               WHEN servicetype LIKE '%VDSL%' THEN 1 
               ELSE NULL 
             END) AS VDSL, 
       Count(CASE 
               WHEN servicetype LIKE '%FTTH%' THEN 1 
               ELSE NULL 
             END) AS FTTH 
FROM   @tablename

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results