View Single Post
Old 06-09-2022, 01:12 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,053
Quote:
Originally Posted by Publisher Bucks View Post
I have a column with sales, for example 5, and another column that has refunds, -2 would the total_amount be 3 when displayed?
No, because you have not summed the 2 columns. The code I posted only sums one column.

You would have to do something like select sum(sales + refunds) to total_amount

But don't take my word for it. Run some test queies, play with the sql some so you can see the results.

.
__________________
All cookies cleared!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote