MySQL Forums
Forum List  »  PHP

Calculating Columns
Posted by: B R
Date: April 23, 2020 09:19PM

I have a transactions table with a credit and debit column. (Don't worry I'm not trying to be a bank, it's a small reward program).

Is it possible or how can I in one query calculate all credits and all debits then work out the difference?

I know how to do SELECT SUM(Credit) as SumTotal etc but not sure how I can get a balance total in a single command.

Options: ReplyQuote


Subject
Written By
Posted
Calculating Columns
B R
April 23, 2020 09:19PM
April 27, 2020 03:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.