标签: mysql
表应该是:
Factory1 DC_Westbengal 2000.......... Factory1 customer6 1000.......... Factory1 DC_Hyderabad 1000
答案 0 :(得分:1)
您需要GROUP BY
GROUP BY
SELECT Name, Loc, SUM(QTY) AS QTY FROM dbo.tablename GROUP BY Name, Loc