Skip to content

Incorrect answers #1

@wizofaus

Description

@wizofaus

At least one answer is simply incorrect (the very last one, showing total & 1997 revenues per customer - the total for the CENTC customer doesn't match). And many of them can be simplified considerably (including that one, which I have as

SELECT CustomerID, CompanyName, Country, 
	(SELECT ISNULL(SUM(Subtotal),0) FROM OrderSubTotals WHERE Year(OrderDate)=1997 AND OrderSubTotals.CustomerID = Customers.CustomerID) Sales97,
	(SELECT ISNULL(SUM(Subtotal),0) FROM OrderSubTotals WHERE OrderSubTotals.CustomerID = Customers.CustomerID) SalesTotal
FROM Customers
ORDER BY SalesTotal

(after creating OrderSubTotals to add OrderDate and CustomerID to the [Order Subtotals] VIEW).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions