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 |
t1 col1 col2 nishi 5000 lucky 6700 akash 7000 i want that a query that when i insert 7000 it will show me data already present and data will not insert. if data is not present it will insert.
Can we write dml statement in function in oracle?
query optmization techniques and quwry analyser+projects+ppts
What are set operators?
What is the difference between "as" and "is" in an oracle stored procedure?
what is the difference between primary key & foreign key?
57 Answers CTS, Infosys, La Multi, Sparsh, Wipro,
What is an Extent ?
Explain drop constraint oracle?
Difference between hot backup vs. Cold backup?
Can a formula column be obtained through a select statement ?
Explain how are indexes update?
What do you mean by a tablespace?