title: Correct MySQL JOIN format to avoid nested SELECT
body: <p>I have two separate SELECT statements:</p>
  
  <pre><code>SELECT VCe.VId FROM `VCe` WHERE `YId` = 9007 AND `MaId` =76 AND `MoId` = 2851
  
  SELECT r_pts.p_id FROM r_pts WHERE r_pts.v_id IN (57202, 57203, 69597, 82261, 82260, 69596, 69595, 82259)
  </code></pre>
  
  <p>When they are run separately they both complete in under .05sec however when I nest the first one within the second, it dramatically increases to 3.3sec.</p>
  
  <p>I would like to do a join so that I can get the output from the second SELECT using the first select as the result set for the IN() but I cannot figure out how to include WHERE conditions in a JOIN.</p>
  
  <p>Edit: Also what is the correct syntax to do a join as I am requesting?</p>
  
  <p>Thanks for your help, its appreciated! </p>