0
I have two tables:
Table accounts with column value with two records totaling 1100; Table receipts with column value with a record totaling 500
I want to perform a query where I receive the sum of each table, I tried something like:
SELECT SUM(accounts.value) the totals , SUM(accounts_receive.value) the totalentries FROM accounts, accounts_receive
However, the total entries I receive from the query are 1000 and not 500. Why does this happen?
You have to split it in two darlings. One to add up the total table
contas
and another to add up the total ofcontas_receber
. This is probably because of this, since there is no relationship between the consultations.– user98628