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 / narasimha

SEL PROD_ID, GREATEST(JAN,FEB,MAR,APR) AS MAX_SALE FROM TABLE_NAME
QUALIFY ROW_NUMBER() OVER (ORDER BY MAX_SALE) =1;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the procedure via which, we can run Teradata jobs in a UNIX environment.

571


List out teradata data types?

559


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

561


What is the particular designated level at which a LOCK is liable to be applied in Teradata?

600


What are the newly developed features of Teradata?

573






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

591


Highlight all the modes that are present under Confidence Level.

540


What is oltp?

570


What is the use of having index on table?

584


Highlight a few of the advantages that ETL tools have over Teradata.

611


What does sleep function does in fast load?

620


What is meant by a Clique?

589


What are different table types used in teradata?

587


What's the difference between timestamp (0) and timestamp (6)?

640


What is bteq utility in teradata?

573