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 a stored procedure? : Sql dba
How do I run a script in sql developer?
What is assignment operator in pl sql?
How to run sql statements with oracle sql developer?
How many clustered indexes can you have?
How does an execution block start and end in pl sql?
What are the possible values for the boolean data field?
What are the types of views in sql?
What is tuple in sql?
what are the drivers in mysql? : Sql dba
What is acid property in a database?
Define a temp table?
What are pl sql procedures?
Does db2 use sql?
Can pl sql procedure have a return statement?