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 set serveroutput on in pl sql?

1285


What is the difference between the sql*loader and import utilities? : aql loader

1031


What is scope and visibility in PL/SQL?

1193


what is recursive stored procedure? : Sql dba

979


Why do you partition data?

1016


what is a unique key ? : Sql dba

1087


Is sql difficult?

1148


How many types of tables are there?

947


Who is the owner of mysql database?

1053


what is the difference between rownum pseudo column and row_number() function? : Sql dba

1068


What is normalization? How many normalization forms are there?

1080


How to connect a sql*plus session to an oracle server?

1118


What are sql queries used for?

1022


What is a primary key? Explain

970


What is user defined functions?

962