Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 error select distinc Select distinc ?

Author  Topic 

u2p_inst
Yak Posting Veteran

78 Posts

Posted - 2002-09-13 : 06:37:42
what the sql sintaks ihave to write for this case:

My table the output i need

CustID ProdName price CustID ProdName price
1 duit 9 1 duit 14
1 duit 5 1 afri 7
1 afri 7 --> 2 duit 5
2 duit 5 2 afri 5
2 afri 5 3 afri 7
3 duit 8 3 duit 15
3 duit 7
3 afri 4
3 afri 3


oh

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2002-09-13 : 08:09:50
SELECT CustID, ProdName, SUM(price) AS price
FROM "My Table"
GROUP BY CustID, ProdName
ORDER BY CustID


Go to Top of Page
   

- Advertisement -