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

sel case
when m1-m2 >0 and m1-m3 >0 then m1
when m2-m1>0 and m2-m3>0 then m2
when m3-m1>0 and m3-m2 >0 then m3
end as maxmaks,m1,m2,m3,id from ttemp.t3;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we collect statistics on table level?

605


What is the difference between union and union all in teradata?

625


Discuss the advantages of using partitioned primary index in a query?

535


Why does varchar occupy 2 extra bytes?

610


What is called partitioned primary index (ppi) and discuss the advantages of using it in a query?

548






Briefly explain each of the following terms related to relational database management system (rdbms) – database, tables, columns, row, primary key and foreign key.

593


What are the string manipulation operators and functions associated with teradata?

637


Explain some differences between mpp and smp?

592


What are the various indexes in teradata? How to use them? Why are they preferred?

594


What are the functions of a Parser?

610


What is the purpose of indexes?

593


What do high confidence, low confidence and no confidence mean in explain plan?

591


Highlight a few of the important components of Teradata?

586


What are some commonly used bteq scripts?

567


How do you verify a complicated sql?

632