Multiplication of two colomns
My table is bellow
productId productQty productRate
1 10 100
2 20 200
3 30 300
4 40 400
5 50 500
I want @qtyRate = productQty*productRate
then sum the @qtyRate using sqlserver 2005
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorababu MekaPosted Jul 25, 2011, 5:32 AM
Dorababu MekaPosted Jul 22, 2011, 5:42 AM
select
(Rate*Qty)
as qtyRate from tblName
UNION ALL
select
sum(Rate*Qty) as qtyRate from tblName
Dorababu MekaPosted Jul 22, 2011, 5:23 AM
Dorababu MekaPosted Jul 22, 2011, 5:07 AM