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 / 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 |
What is Segment Advisor in Oracle?
What are nested tables?
can anyody please send me the dump for Oracle 10g certifications for DBA path?
What is a subquery?
What is TNS File
How can I convert single byte kana characters into multi byte kana characters and vice-versa.
What does sharding mean?
What is index-organized table in Oracle?
What are the factors that affect OPTIMIZER in choosing an Optimization approach ?
Write a syntax for update query in oracle?
who is the father of oracle and send chodd rules
What is the difference between a vector and an Array? (Java)