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 a stored procedure? : Sql dba

1189


How do I run a script in sql developer?

997


What is assignment operator in pl sql?

1086


How to run sql statements with oracle sql developer?

1121


How many clustered indexes can you have?

1037


How does an execution block start and end in pl sql?

997


What are the possible values for the boolean data field?

1012


What are the types of views in sql?

1140


What is tuple in sql?

1141


what are the drivers in mysql? : Sql dba

1059


What is acid property in a database?

1086


Define a temp table?

1078


What are pl sql procedures?

1077


Does db2 use sql?

1009


Can pl sql procedure have a return statement?

1072