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



The table has 3 columns 4 rows. The output is which column has least null values( A COL SHOULD BE TH..

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

Post New Answer

More Oracle General Interview Questions

Define Transaction ?

5 Answers  


what is meant by magic query

0 Answers  


List the parts of a database trigger.

0 Answers  


What is literal?

0 Answers  


What is the difference between Sleep and Wait? (Java)

1 Answers   RBS,






interview questions with answer for cts

0 Answers   Cognizant,


what are the diffeenes between oracle 9i,oracle 10g

2 Answers  


What are oracle functions?

0 Answers  


What is difference between SUBSTR and INSTR?

1 Answers  


How to delete multiple rows from a table in oracle?

0 Answers  


without using count(*) and rownum how can we count total record in a table

5 Answers   AC, HP,


Explain what are the different type of segments?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)