Skip to content
Advertisement

Mysql Join, Count and Sum?

campaign table are the item for sale and on the transaction table are the item sold. I want to count the transaction_id that are made transaction table and sum the total of sold item.. but the table are different..

Here is what I tried:

campaign table:

transactions table:

Advertisement

Answer

To get the total payout for all transactions you need to perform a join. For example:

The SUM() function will add up all values from the payout column.

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