I have a table with two columns that might be null (as well as some other columns). I would like to count how many rows that have column a, b, both and neither colu
null
One way to do it would be:
select count(*) from table group by nvl2(a, 0, 1), nvl2(b, 0, 1) having nvl2(a,0,1) = nvl2(b,0,1);