title: How can I join these two complex queries?
body: <p>I have two queries, and they are quite comlpex, so I can't seem to figure out how to join them.</p>
  
  <p>I want to find the resulting set when <code>Q1.notAnyFewID = Q2.FBID</code> from the two queries</p>
  
  <p>Q1:</p>
  
  <pre><code>SELECT DISTINCT notifications.`receiver` AS notAnyFewID
  FROM notifications
  JOIN 
  (SELECT notifications.`ref` AS notRef, notifications.`receiver` AS recI
      FROM notifications
      WHERE notifications.`ref`='tooFewLandings') AS c
  ON notifications.`receiver`=c.recI
  WHERE notifications.`receiver`!=c.recI
  </code></pre>
  
  <p>Q2:</p>
  
  <pre><code>SELECT DISTINCT R2PProfiles.id AS r2pID, R2PProfiles.`facebookID` AS FBID
  FROM R2PProfiles
  LEFT JOIN
        (SELECT COUNT(*) AS Landings, R2PProfiles.facebookID, R2PProfiles.id
              FROM pageTrack         
              JOIN (R2PProfiles)
          ON (pageTrack.inputRefNum = R2PProfiles.id)
  WHERE pageTrack.ref='getProfile-Land' AND R2PProfiles.published=2 AND R2PProfiles.`createTime`&lt; NOW()- INTERVAL 24 HOUR GROUP BY R2PProfiles.id) AS h
  USING (id) WHERE (Landings &lt; 20)
  </code></pre>
  
  <p>When trying to combine them I seem to always get messed up in join or sub-selects or "using" or where and how to get the new where correct.</p>
  
  <p>What is the best approach for making one of the queries compare against the result of the other one?</p>