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
WHAT IS ecc 6.0
material view and view disadvantages?
What are operators in oracle?
How we can able to import our own template (users designed MS-Word templates) which has many tabular columns; need to pass some values generate by Oracle-reports9i? Actually need to import more than 400 MS-Word templates into Oracle Reports-9i to minimize layout design in Reports.
Explain the use of analyse option in exp command.
Explain table?
What is background process in Oracle?
How to get a create statement for an existing table?
When do you get a .pll extension in oracle? Explain its importance
What are the uses of a database trigger?
How can I introduce multiple conditions in like operator?
How do I use os authentication with weblogic jdriver for oracle and connection pools?
Explain a synonym?
What is the difference between truncate & delete command?
How to use "in out" parameter properly?