SELECT C.id, c.[name], SUM(g.[gold]) AS [CountOfGold] FROM Customer AS C INNER JOIN Gold AS G ON C.id = G.custid GROUP BY C.id, c.[name]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)