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 / mahalakshmi s

select case when col1>col2 then 'col1' else 'col2' end, greatest(col1,col2) end from table_name;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is partition in sql query?

1044


how can we know the number of days between two given dates using mysql? : Sql dba

1082


Can you select everything, but 1 or 2 fields, without writer's cramp?

1037


Is vs as in pl sql?

1036


How do you optimize a query?

1058


What is java sql drivermanager?

1159


Explain aggregate functions are available there in sql?

1048


Does sql view stored data?

1003


What can you do with pl sql?

1140


Which sorts rows in sql?

1055


What are pl/sql cursor exceptions?

1162


How do you copy a table in sql?

1109


How do I start sql profiler?

1046


What are the differences between in and exists clause?

1161


how to increment dates by 1 in mysql? : Sql dba

1028