0
我想「翻譯」這個查詢到fluentPDO聲明,但我不能找到一種方法,使用子查詢它子查詢中fluentPDO
SELECT plan.*, COUNT(DISTINCT click.id) AS clicks, COUNT(DISTINCT impression.id) as impressions, IFNULL(A.earnings, 0) AS earnings FROM plan
LEFT JOIN click ON click.plan_id = plan.id
LEFT JOIN impression ON impression.plan_id = plan.id
LEFT JOIN (
SELECT plan_id AS earnings_id, SUM(signup.earning) as earnings FROM signup
) A ON A.earnings_id = plan.id
GROUP BY plan.id
任何幫助嗎?