The table has 3 columns 4 rows. The output is which column has least null values( A COL SHOULD BE THE OUTPUT)
Write the query plz.
A B C
----------
1 NULL 7
2 4 NULL
NULL 5 NULL
3 NULL NULL
Answer Posted / rameshganesan
Select (Case
When a = Least Then (select 'O/P A ='||ListAgg(a,' ') Within Group(order by a) from Least_Col)
When b =Least Then (select 'O/P B ='||ListAgg(b,' ') Within Group(order by b) from Least_Col)
Else (select 'O/P C ='||ListAgg(c,' ') Within Group(order by c) from Least_Col) end)ab
From (Select count(a) a,count(b) b,count(c) c,greatest(count(a),count(b),count(c)) Least From Least_Col);
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
defination of bitmap index
What is the effect of setting the value "all_rows" for optimizer_goal parameter of the alter session command? What are the factors that affect optimizer in choosing an optimization approach?
A table t is there.If you perform insert ,update and delete then the trigger will fire.What is the minimum no of trigger required for a table.
What are the system predefined user roles?
What is the difference between $oracle_base and $oracle_home?
How to divide query output into groups in oracle?
What does sharding mean?
How to test null values?
What is data type in oracle?
How remove data files before opening a database?
Is truncate autocommit in oracle?
How to update a table row with a record?
How to start your 10g xe server?
What is the difference between sharding and partitioning?
Explain an exception and its types?