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

can a view be updated?

3 Answers  


 How to use an oracle sequence generator in a mapping?

0 Answers   Informatica,


If any one has information regarding interview of NIC (National Informatics Centre),it would be of great help...

0 Answers   NIC,


write a sql query following source looking like below column1 column2 101,102,103 abc,def,ghi 1001,1002,1003 a,b,c i want the output column1 column1 101 abc 102 def 103 ghi 1001 a 1002 b 1003 c

1 Answers   KPIT,


what are indexes..how many types of index's are there and what are they?

7 Answers   TCS, Green Info Solutions,






which is best insttute for teradata,sybase,mysql,oracle in hyderabad

1 Answers  


i must get table name, constraint type, constrain name with using concads "||" and it must be in string type, then with join processes i need code please help immidiately

1 Answers  


State some uses of redo log files?

0 Answers  


What are the ways tablespaces can be managed and how do they differ?

0 Answers  


Why we choose emp number as primarykey?

4 Answers  


What is analyze command used for?

0 Answers  


What is the exact use of Collections?

0 Answers  






Categories
  • Oracle General Interview Questions Oracle General (1658)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (188)
  • 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 (509)
  • 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)