Sunday, June 2, 2013

suggest me a query to produce a result that shows sum of total due amount for each customer

seems quite easy with a simple JOIN



SELECT c.customer_name,
SUM(i.due_amount) AS due_amount
FROM dbo.customer c INNER JOIN dbo.invoices i
(c.customer_id = i.customer_id);





Uwe Ricken



MCM SQL Server 2008

MCSE - SQL Server 2012

MCSA - SQL Server 2012



db Berater GmbH

http://www-db-berater.de

SQL Server Blog (german only)


No comments:

Post a Comment