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

What is sap sql anywhere?

1047


how can we know the count/number of elements of an array? : Sql dba

1043


what are rollup and cube in t-sql? : Transact sql

1071


What is the syntax to add a record to a table?

1071


What is rowtype?

997


What is the difference between instead of trigger and after trigger?

980


Why we use joins in sql?

964


What is sql stand for?

970


what is a view? : Sql dba

1063


How do I truncate a sql log file?

1053


what are all the different types of indexes? : Sql dba

1034


Is merge a dml statement?

952


Does view store data in sql?

942


How many disk partitions should I have?

974


How do you select unique values in sql?

980