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 |
What is the difference difference between $ORACLE_HOME and $ORACLE_BASE.
can a table has a column that has only view data and in other columns we can change data?
how to find full database size
1 Answers BirlaSoft, Consultancy,
In the oracle version 9.3.0.5.0, what does each number shows?
Define oracle database
How to find out what privileges a user currently has in oracle?
How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?
What happens if the imported table already exists?
how to make an oracle object
what diffrence between function and procedure?
how to convert .db (extention) database file into .dmp (extention ) for oracle database ?
what are the things that you consider while creating indexes on partitioning tables?