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
List and explain the different types of join clauses supported in ansi-standard sql?
what are the type of locks ? : Sql dba
What packages(if any) has oracle provided for use by developers?
What is implicit cursor in pl sql?
What is sql trigger example?
If a cursor is open, how can we find in a pl/sql block?
What is acid property in a database?
What is scalar function?
Why is partition used in sql?
How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?
how can we destroy the session, how can we unset the variable of a session? : Sql dba
Describe types of sql statements?
What is the use of pl/sql table?
What are expressions?
How many columns should be in an index?