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 set serveroutput on in pl sql?
What is the difference between the sql*loader and import utilities? : aql loader
What is scope and visibility in PL/SQL?
what is recursive stored procedure? : Sql dba
Why do you partition data?
what is a unique key ? : Sql dba
Is sql difficult?
How many types of tables are there?
Who is the owner of mysql database?
what is the difference between rownum pseudo column and row_number() function? : Sql dba
What is normalization? How many normalization forms are there?
How to connect a sql*plus session to an oracle server?
What are sql queries used for?
What is a primary key? Explain
What is user defined functions?