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 |
Define Transaction ?
what is meant by magic query
List the parts of a database trigger.
What is literal?
What is the difference between Sleep and Wait? (Java)
interview questions with answer for cts
what are the diffeenes between oracle 9i,oracle 10g
What are oracle functions?
What is difference between SUBSTR and INSTR?
How to delete multiple rows from a table in oracle?
without using count(*) and rownum how can we count total record in a table
Explain what are the different type of segments?