Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

List and explain the different types of join clauses supported in ansi-standard sql?

1358


what are the type of locks ? : Sql dba

968


What packages(if any) has oracle provided for use by developers?

5813


What is implicit cursor in pl sql?

1098


What is sql trigger example?

1072


If a cursor is open, how can we find in a pl/sql block?

1169


What is acid property in a database?

1037


What is scalar function?

1058


Why is partition used in sql?

1130


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

1144


how can we destroy the session, how can we unset the variable of a session? : Sql dba

1005


Describe types of sql statements?

1064


What is the use of pl/sql table?

1071


What are expressions?

1019


How many columns should be in an index?

964