Hi All,
I have below table
create table nsk_abc(a number, b number, c number);
insert into nsk_abc values (1,null,2);
insert into nsk_abc values (null,3,4);
insert into nsk_abc values (null, 5, 6);
insert into nsk_abc values (2, null, null);
commit;
Expected output :
is Column C because it contains least NULLS out of columns a and b.
using below query, am able to get the minimum column that is having outtput as Null Values, but how to get the values of the column
select sum(decode(a,null,1,0)) a_null_cnt,
sum(decode(b,null,1,0)) b_null_cnt,
sum(decode(c,null,1,0)) c_null_cnt
from nsk_abc
i.e., column C with values 2, 4, 6 and NULL should be returned, am only able to find the column, but how retrive the values in sql