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 |
How to call a stored function with parameters?
How to convert csv to table in oracle?
How do I uninstall oracle client from windows?
Maximum how many triggers can be updated in table ?
5 Answers Accenture, Cap Gemini,
What is the oracle implicit cursor?
1.how to extract the second highest salary from emp table having sal as a column which contains the salary of all employee of an organisation.
Which Functions Using Integer ==> String's i.e 2 ==> Two... Like that string's ==> integer values ? It is Possible ?
Can the default values be assigned to actual parameters?
What is oracle host variable?
What privilege is needed for a user to query tables in another schema?
What are the differences between lov and list item?
Write a simple Store procedure and pass parameter to it ?