title: Join two tables in MySQL, returning just one row from the second table
body: <p>I have two tables: gallery and pictures:</p>
  
  <p><strong>gallery</strong></p>
  
  <pre><code>id           int (auto increment, primary key)
  name         varchar
  </code></pre>
  
  <p><strong>pictures</strong>  </p>
  
  <pre><code>id           int (auto increment, primary key)
  picture      varchar
  gallery_id   int (foreign key)
  </code></pre>
  
  <p>How do I join these two tables showing for each row from the left table (gallery) just the first row from the second table, without going through all the rows from the second table? I am using MySQL.</p>
  
  <p>My objective is to make a page containing a list of the existing galleries showing a picture for each gallery as a link to the details page with all the pictures of that gallery.</p>
  
  <hr>
  
  <p>I have searched this question on this site but the similar questions are too complicated. I'm only interested in this simple example.</p>