sql question regarding sum() and tax (MySQL 5.0.89)
Posted
by jason
on Stack Overflow
See other posts from Stack Overflow
or by jason
Published on 2010-03-28T07:41:56Z
Indexed on
2010/03/28
7:43 UTC
Read the original article
Hit count: 261
Select
id,
sum(amount),
vat
From transactions WHERE id=1;
Each record in this table has a vat percentage, I need to get the total amount in all records, however each amount has to be multiplied by by its vat %.
Is there away to do this without looping through all records?
© Stack Overflow or respective owner