I have a table bellow
productId productQty productRate
1 10 100
2 20 200
3 30 300
4 40 400
5 50 500
i need the out put is bellow
productQty
-----------
(10*100)+
(20*200)+
(30*300)+
(40*400)+
(50*500)
in SQL Server 2005
Product of two table feilds
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Manikavelu VelayuthamRank #413 · 6K reputationPosted Jul 22, 2011, 1:05 AM EDT
Zoran HorvatRank #792 · 2.9K reputationPosted Jul 22, 2011, 1:04 AM EDT
Then the query is this:
SELECT SUM(Value) AS Total FROM (SELECT productQty * productRate AS Value FROM Product);
Zoran
jayakrishnan Morayur156 reputationPosted Jul 22, 2011, 1:12 AM EDT