Skip to content
Advertisement

MySQL result select SUM from the database

I’ve the following tables and I try to select from table1, table2 and table3 and sum them in total:

What i’ve done is currently this

result

So far so good, but i’m looking for this result

I tried with

but this result is still the same result as the first one

Searched now about a hour on google to find a solution and this was my best try to get any result at all what i’m looking for. If there is also a better solution i’d really like to learn more about it. Anyway for any fix for my question would be amazing.

EDIT:

sample data http://sqlfiddle.com/#!9/c063a7/4

Advertisement

Answer

If you want to find the total the u have to sum all the individual totals not union them

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement