I got a table with webmasters and one with customer billing data.
I now want to query a list of each webmasters earnings that were referred by another webmaster.
So basically it should sum the Amounts for each webmaster out of the monthly billing table.
I think 2 queries might do the job:
1 to determine the webmasters
Code: Select all
SELECT Web_ID FROM Webmasters WHERE Referrer = '10152'Code: Select all
SELECT SUM(m.Amount) FROM Customers c, Monthly_Billing m WHERE c.Webmaster = '$webmaster' AND m.Customer = c.Customer