title: MySQL: How to select min() using subquery and joins
body: <p>I have 3 MySQL tables. I've trimmed them down to show just the important columns</p>
  
  <pre><code>items
  id |  title                   |
   1 |  Hamlet                  |
   2 |  Romeo and Juliet        |
   3 |  The Merchant of Venice  |
  
  
  listings
  id | item_id |    condition     |
   1 |    1    |    Mint          |
   2 |    1    |    Used - Good   |
   3 |    2    |    New           |
   4 |    2    |    Mint          |
   5 |    2    |    Used - Poor   |
   6 |    3    |    Used - Poor   |
   7 |    3    |    Used - Good   |
   8 |    3    |    Used -  Good  |
  
  
  itemListings_variations
  id | listing_id |   price    
   1 |     1      |    20.00
   2 |     1      |    10.00
   3 |     1      |     5.00
   4 |     2      |     6.00
   5 |     2      |     5.50
   6 |     3      |     2.00
   7 |     4      |    12.00
   8 |     5      |     3.00
   9 |     6      |     9.00
  </code></pre>
  
  <p>If e.g. I search for Romeo and Juliet, it should return:</p>
  
  <pre><code>item_id  |       title            |  min_price
     2     |   Romeo and Juliet     |     2.00
  </code></pre>
  
  <p>So far I have two queries which somehow need combining via subqueries and joins. I have:</p>
  
  <pre><code>SELECT 
  i.id AS item_id,
  i.title 
  FROM items i
  WHERE  MATCH (i.title) AGAINST (:search)
  </code></pre>
  
  <p>also:</p>
  
  <pre><code>SELECT 
  l.item_id,
  v.listing_id,
  MIN(price) AS min_price
  FROM itemListings_variation v, itemListings l
  WHERE v.listing_id = l.id
  GROUP BY v.listing_id
  </code></pre>