title: SQL: Get all posts with any comments
body: <p>I need to construct some rather simple SQL, I suppose, but as it's a rare event that I work with DBs these days I can't figure out the details.</p>
  
  <p>I have a table 'posts' with the following columns:</p>
  
  <blockquote>
    <p>id, caption, text</p>
  </blockquote>
  
  <p>and a table 'comments' with the following columns:</p>
  
  <blockquote>
    <p>id, name, text, post_id</p>
  </blockquote>
  
  <p>What would the (single) SQL statement look like which retrieves the captions of all posts which have one or more comments associated with it through the 'post_id' key? The DBMS is MySQL if it has any relevance for the SQL query.</p>