Hai,
i have a table with the following records.
month,dealercode,branch,netqty
can anybody kindly give me SQL Command which will sum netqty group by dlrcod and month but for each dealer monthqty should appear vertically.
select dlrcod,branch,sum(netqty) from <table name> group by dlrcod,month
with this query i get month totals horizontally but i want months to appear vertically.
if any body can kindly give me a query, i would be greatful
eg.
mnth delaer code branch netqty
january a0001 blr 1000
april a0001 blr 500
feb a0001 blr 300
may b0001 blr 400
june b0001 blr 300
january a0001 blr 200
march c0001 blr 100
april d0001 blr 200
may d0001 blr 100
may e0001 blr 50
i want an output table in this format. can any body kindly give me the sql command to do that.
dlrcod branch january feb march april may june
a0001 blr 1200 300 500
a0001 blr 200
b0001 blr 400 300
c0001 blr 100
d0001 blr 200 100
e0001 blr 50
Thanks
(Lakshminarayana R)
Visual FoxPro2
|