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

Explain what is a database?

1036


How do I run a script in sql developer?

898


Write a unique difference between a function and a stored procedure.

924


What are the different sql languages?

984


Write a sql query to find the names of employees that begin with ‘a’?

951


What are views in sql?

925


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

992


How do I start pl sql?

895


What is a data definition language?

1026


What is varchar sql?

1058


How to find 3rd highest salary of an employee from the employee table in sql?

1034


what is data manipulation language? : Sql dba

945


What is record in pl sql?

1009


How to fetch alternate records from a table?

1157


What are reports usually used for?

966