All pastes #163735 Raw Edit

Mine

public sql v1 · immutable
·published 2006-09-07 20:44 UTC
rendered paste body
   SELECT d.ID        , ROUND(SUM(te.Price * te.Quantity), 2)     FROM Item iLEFT JOIN Department d ON d.ID = i.DepartmentIDLEFT JOIN TransactionEntry te ON te.ItemID = i.IDLEFT JOIN [Transaction] t ON te.TransactionNumber = t.TransactionNumberLEFT JOIN Batch b ON t.BatchNumber = b.BatchNumber    WHERE b.ClosingTime >= '2006-07-17'      AND b.ClosingTime < '2006-07-18'    GROUP BY d.ID