How can u find column name from a table which have max value
in a row.( not max value)

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we call a function containing dml statements in a select query?

722


What is sql select statement?

703


Can we create a trigger on view?

666


Explain unique key in sql.

738


Can we insert data into materialized view?

708






What does rownum mean in sql?

721


what is an extent ? : Sql dba

751


in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

1830


How do you bind variables in pl sql?

756


Why do we create views in sql?

775


what is a join? : Sql dba

768


ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..

2176


What is string join?

746


What is the command used to fetch the first 5 characters of a string?

922


Why truncate is faster than delete?

786