Luis Cazares - Wednesday, February 14, 2018 1:55 PM
Another option is to use MAX or MIN instead of SUM.
SELECT W.ID,
MAX(W.[Group]) AS [Group],
SUM( WD.Payment) AS Payment,
MAX(W.Invoice) AS Invoice
FROM Widget W
JOIN WidgetDetail WD ON W.ID = WD.ID
GROUP BY W.ID
Also, you shouldn't use reserved keywords as column names, but if you do, you should at least quote them.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA