If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
How can I do that ?
I have tried it with a sum() on a self-join like :
SELECT t."Article", SUM(t1."Amount") , SUM(t2."Amount"), SUM(t3."Amount")
FROM "Test" t
left outer join "Test" t1 on (t."Article" = t1."Article" AND t1."Qual"=1)
left outer join "Test" t2 on (t."Article" = t2."Article" AND t2."Qual"=2)
left outer join "Test" t3 on (t."Articlel" = t3."Article" AND t3."Qual"=3)
group by t."Article"
thanks for your answer, but that won't work.
The problem is, that I must have 3 Sum-columns from Row-Data.
The field Qual can be 1, 2 or 3. And I need these Sumaries in one line, like "article Sum1 Sum2 Sum3". I can't use Temp-Tables or anything else.
select article,
sum(decode(qual,1,Amount,null)) Q1,
sum(decode(qual,2,Amount,null)) Q2,
sum(decode(qual,3,Amount,null)) Q3
from your_table_goes_here
group by article
This should work if you have a limited number of Qual. If not, ...