Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a question I have this query:
VentasXSalesPerson:
SQL Select SOH.SalesPersonID as SalesPerson,sum(SOH.SubTotal) AS [VentaTotal] from Sales.SalesOrderHeader SOH
inner join Sales.SalesPerson as SS on SS.SalesPersonID = SOH.SalesPersonID
group by SOH.SalesPersonID;
Productos:
SQL SELECT ass.[SalesOrderID]
,ass.[OrderQty]
,ass.[ProductID], pp.Name
FROM [AdventureWorks].[Sales].[SalesOrderDetail] as ass
INNER JOIN Production.Product pp on pp.ProductID = ass.ProductID;
And I want to see how many products each sales person made and the amount, but this is what I got:
As you can see the sales Person 268 sold different products for example: 742, 741 etc... but it's summing all of them,
I attached the qv file so that you can help me.
you're missing a link between your sales and product tables
can you tell me what would be the exact total you require in this case?
you're missing a link between your sales and product tables