tsql - T-SQL filter on external join -


using schema below, write query lists total value of sales customers bought item sales person same middle initial them. query should return single result.

the quantity , price columns both ints. sales - employee link on employeeid - salespersonid. enter image description here

something should work:

select sum(s.quantity * p.price) totalsales sales s join products p on s.productid = p.productid join customers c on s.customerid = c.customerid join empleyees e on s.salespersonid = e.employeeid c.middleinitial = e.middleinitial 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -