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 2
NULL 3 4
NULL 5 6
7 NULL NULL
O/P
C
=
2
4
6
Answers were Sorted based on User's Feedback
Answer / rameshganesan
Select (Case
When a = Least Then (select 'A'||CHR(10)||'='||CHR(10)||ListAgg(a,CHR(10)) Within Group(order by a) from Least_Col)
When b =Least Then (select 'B'||CHR(10)||'='||CHR(10)||ListAgg(b,CHR(10)) Within Group(order by b) from Least_Col)
Else (select 'C'||CHR(10)|| '='||CHR(10)||ListAgg(c,CHR(10)) 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 ? | 1 Yes | 0 No |
State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.
What privilege is needed for a user to create indexes in oracle?
Can objects of the same schema reside in different tablespace?
What is Private Database Link ?
What is a subquery?
What are the arithmetic operations?
What is the purpose of init.ora. ? how many init.ora exist in oracle installation? suppose there are 3 database on one oracle server, how many init.ora do I have? what are various database objects? how will you identify memmory related performace issue in oralce? any idea about basic architure difference of oracle and db2? comment on which is better , with reasons? what is a fuction based index? is it recommended to use the same. ? what is global temporay table? what is teh signification of the parameter session_cached_cursor ?
What is the effect of setting the value "ALL_ROWS" for OPTIMIZER_GOAL parameter of the ALTER SESSION command ?
What spfile/init.ora file parameter exists to force the CBO to make the execution path of a given statement use an index, even if the index scan may appear to be calculated as more costly?
What is a nvl function? How can it be used?
what is the difference between authorization and authentication?
HI, Please let me know the syllabus for Oracle OCA and OCP Certification