How can u find column name from a table which have max value
in a row.( not max value)
Answer Posted / gaurav
select decode( (select sal from emp where empno = 7521) , (select greatest( sal, comm ) from emp where empno = 7521 ), 'sal', 'comm' ) from dual
You can use multiple decode if more number of columns are there.
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is loop in pl sql?
Is postgresql a nosql database?
The select into statement is most often used to create backup copies of tables or for archiving records?
Is merge a dml statement?
Does google use sql?
What is a column in a table?
What is the benefit of foreign key?
how to get a list of columns in an existing table? : Sql dba
What is data control language?
What is a mutating table and a constraining table?
How bulk collect improves performance?
What are the dml statements?
What is a recursive join sql?
what is single byte over head in oracle..?
Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?