title: Subquery in fluentPDO
body: <p>I'm trying to "translate" this query into a fluentPDO statement but i can't find a way to use subqueries with it</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Any help?</p>