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
Does view store data in sql?
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
How many types of primary keys are there?
What is a .db file?
What is scalar data type in pl sql?
Why stored procedure is better than query?
What is the current version of sql?
How delete a row in sql?
table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
What is procedure explain with program?
what are the difference between clustered and a non-clustered index? : Sql dba
what is the use of friend function? : Sql dba
Is big data nosql?
Can we use having without group by in sql?
What are the operators in sql?