Subject | Query with sum |
---|---|
Author | Planles |
Post date | 2004-12-31T11:05:27Z |
Hello,
I have folowing table:
ID Name Qty
1 aaa 1
2 aaa 1
3 ccc 1
4 ccc 1
This query
select
SUM(Qty) AS SumQty,
Name
from table
group by 2
would give me folowing result
Name Qty
aaa 2
ccc 2
Is there a way, to get in my result info, which IDs were sumed togehter, eg:
Name Qty IDs
aaa 2 1,2
ccc 2 3,4
Regards and all the best in 2005,
Primoz
I have folowing table:
ID Name Qty
1 aaa 1
2 aaa 1
3 ccc 1
4 ccc 1
This query
select
SUM(Qty) AS SumQty,
Name
from table
group by 2
would give me folowing result
Name Qty
aaa 2
ccc 2
Is there a way, to get in my result info, which IDs were sumed togehter, eg:
Name Qty IDs
aaa 2 1,2
ccc 2 3,4
Regards and all the best in 2005,
Primoz