DB Source
how can I add the result of 4 sum, to get this
I tried this query but the total is wrong, the total include eth05 colunm.
Any idea how to fix that?
select router, count(*) total,
sum (CASE WHEN eth01 is not null then 1 ELSE NULL END) as "eth01",
sum(CASE WHEN eth02 is not null then 1 ELSE NULL END) as "eth02",
sum(CASE WHEN eth03 is not null then 1 ELSE NULL END) as "eth03",
sum(CASE WHEN eth04 is not null then 1 ELSE NULL END) as "eth04"
from Speed_report
where(eth01 = data or eth02 = data or eth03 = data or eth04 = data )
GROUP BY router
;
Best Answer