I currently have 2 tables
TableA and TableB` both within the same MYSQL Database.
I am trying to find a way to take totals from both tables and add them together to give a definitive total.
The tables are used to record Trades. TableA gives the Trade info and TableB gives deposits and withdrawls.
So to get the total Profit/Loss:
Select SUM(PL) AS PL from TableA
Then I can get the total deposits/Withdralws as:
Select SUM(Deposits) AS Deposits, SUM(Withdraw) AS Withdrawls from TableB`
MY question is... I am looking for a way to display to current balance, essentially
SUM(PL) + (SUM(Deposits) - SUM(Withdraw) )
I have looked at the different
join options but cannot seem to find one that works.