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

what is online transaction processing (oltp)? : Sql dba

530


What are analytic functions in sql?

553


What is implicit cursor in pl sql?

544


Which command is used to delete a trigger?

777


What is cascade in sql?

562






Why query optimization is needed?

521


Why do we create views in sql?

562


How does sql store data?

487


How do you declare a user-defined exception?

530


How do I truncate a word?

529


how to get @@error and @@rowcount at the same time? : Sql dba

531


What is a dirty read sql?

487


What is data definition language?

623


Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?

604


What is coalesce in sql?

566