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
Loading

Manikavelu VelayuthamPosted Jul 22, 2011, 5:05 AM
jayakrishnan MorayurPosted Jul 22, 2011, 5:12 AM
Zoran HorvatPosted Jul 22, 2011, 5:04 AM
Then the query is this:
SELECT SUM(Value) AS Total FROM (SELECT productQty * productRate AS Value FROM Product);
Zoran