SELECT MAX(ItemName) ItemName,
ItemCode, SUM(Quantity) Quantity INTO #tmp FROM tblPurchase GROUP BY itemCode;
UPDATE tblProductStock SET Quan