title: how to use value from main query in sub query
body: <p>Im trying to run a sub-query that based on one of the main query values but i always get 0 as VALUE.
  This is my query :</p>
  
  <pre><code>SELECT ID,(
  SELECT COUNT( * ) 
      FROM  `post_meta` 
      WHERE  `post_id` 
      IN (
          SELECT  `ID` 
          FROM  `wp_posts` 
          WHERE  `post_title` = posts.ID
      )
  ) AS counter
  FROM wp_posts;
  </code></pre>
  
  <p>if i run only the sub-query with id number instead of posts.ID it returns a good value.</p>