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...

i have a table like sales....the field are

Prodid Jan(jam month sales)Feb March

1 20 76 50
2 30 94 40
3 40 90 30
4 70 20 30
5 23 40 40
6 85 30 55
7 84 20 65
8 10 93 40
9 57 30 30
10 38 83 40
11 35 39 90
12 83 89 50
Now the Question is i want get the max sales of 12 products
from the months.hint:for eg I WANT GET 89 for product12...

Can any one help me

Answer Posted / naga

sel t.p,t.jan1, t.col_nm
from (

select p,jan1,'jan1' as col_nm from pm1
union
select p,feb1,'feb1' from pm1
union
select p,mar,'mar' from pm1
)t
qualify rank () over(partition by p order by jan1 desc) =1 order by p;

its bit lengthy but not a complex one..I just
added extra col as col_nm to identify the month 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 interface is used to connect to windows based applications?

1119


During the Display time, how is the sequence generated by Teradata?

1068


How you will check the version of teradata?

1175


How teradata makes sure that there are no duplicate rows being inserted when its a set table?

991


What is teradata?

1164


how many modules are there in telecome domain?how to explain the architecture?

2022


What is teradata? Also, list out some of the primary characteristics of teradata.

1063


Explain amp in teradata?

1092


What are the various etl tools in the market?

1075


What do you mean by caching in teradata?

1073


In Teradata, how do we Generate Sequence?

1052


What happens when a node suffers a downfall?

1142


How is MLOAD Client System restarted after execution?

1163


Highlight the points of differences between the database and user in Teradata.

1116


Explain the term 'row' related to relational database management system?

961