How can u find column name from a table which have max value
in a row.( not max value)
Answers were Sorted based on User's Feedback
Answer / mahalakshmi s
select case when col1>col2 then 'col1' else 'col2' end, greatest(col1,col2) end from table_name;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / 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 |
Answer / ganesh
create table aa_test(
a number,
b number,
c number)
;
select greatest(a,b,c) from aa_test where a=99 ;
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / prashanth
user greatedt function.
Ex select greatest(sal,bonus) from emp where emp_id = 1000;
Is This Answer Correct ? | 2 Yes | 6 No |
Whate is use of MOD function in pl/sql.
what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba
Why is normalization important?
What are user defined stored procedures ?
does sql support programming? : Sql dba
What is compute?
What is a merge query?
What is a REF CURSOR? Compare strong and week ref cursor types.
What is a left join?
what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql
Why do we use procedures?
Write a pl/sql script to display the following series of numbers: 99,96,93……9,6,3?