eruna — 2012-01-24T19:16:31-05:00 — #1
Given the application I'm working on, it will simplify things greatly if these two queries can be combined. Is this possible?
Select organization_name, email from partners
SELECT count(*) as 'referrals' ,partner_id
GROUP BY partner_id
organization_name | email | referrals
serverstorm — 2012-01-24T20:18:16-05:00 — #2
I am on my phone now, but if your partners table has a partner_id then you can do something like:
partner_application_stories) AS 'referrals'
partners AS p
INNER JOIN // Returns only matching rows if you want all rows in the p.partner table use LEFT OUTER JOIN or all in right the RIGHT OUTER JOIN
partner_application_stories AS 'pas'
ON p.partner_id = pas.partner_id
GROUP BY pas.partner_id
I won't be at a computer until tomorrow, but give this a try and see if it works for you.
mittineague — 2014-09-23T22:45:14-04:00 — #3
This topic is now archived. It is frozen and cannot be changed in any way.