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

select case when jan>feb and jan>mar and jan> apr and jan>
may and jan>jun then
jan else (case when feb>jan and feb>mar and feb>apr and
feb>may and feb>jun then
feb else (case when mar>jan and mar>feb and mar>apr and
mar>may and mar>jun then
mar else (case when apr>jan and apr>feb and apr>mar and
apr>may and apr>jun then
apr else (case when may>jan and may>feb and may>apr and
may>mar and may>jun then
may else (case when jun>jan and jun>feb and jun>mar and
jun>apr and jun>may then
jun end)end)end)end)end)end from sales;
upto dec we can use similar query to get the max sales from
that sales table i hope u undertand if u have any queries
reach me ravikiran.mca.vadali@gmail.com

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do we write scripts in unix how to execute scripts in real time anybody please needfull or give me number i will cal u

1281


what is sysdba and sysdbc ? which has high priority ?

3372


Is multi insert ansi standard?

1751


What are the various reporting tools in the market?

618


Explain and compare pros and cons of snow flake schemas?

613






What are the enhanced features in teradata v2r5 and v2r6?

695


What is teradata?

648


How do you do backup and recovery in teradata?

551


Explain the new features of teradata?

571


Can we have an unconnected lkp to lookup a db2 record against a teradata record? Doesnt seem to work. I could be wrong

631


Highlight the limitations of TPUMP Utility.

607


Explain the types of join supports by teradata?

588


i learn teradata,it is so intersting,now i want teradata certifications ,so any 1 help me to get teradata certifications TD 12 ? email:kdcrazyy@gmail.com

1771


How to identify ppi columns?

656


What are the different table types that are supported by teradata?

539