In the below query I have 2 tables locationproductmap and productsourceproductmap. My aim is to multiply the quantifier from the productsourceproductmap table with CurrentUnitPrice from the locationproductmap table, and then sum it. But my actual result is displaying incorrect result.
Please help me to do this.
Actual result is 45.
productsourceproductmap
Productid | Quantifier| locationId
-----------------------------------
1402 1 1
1403 1 1
1404 1 1
locationproductmap
ProductId | Locationid |CurrentUnit Price
--------------------------------------------
1402 1 5
1403 1 5
1404 1 5
Query
(Select
SUM(LPM.CurrentUnitPrice * PSPM.Quatifier)
From
LocationProductMap LPM
LEFT OUTER JOIN
ProductSourceProductMap PSPM ON PSPM.ProductID IN (1402, 1404, 1403)
WHERE
LPM.ProductID IN (1402, 1404, 1403)
AND LPM.LocationID = 1
)