title: Combine two sql select queries (in postgres) with LIMIT statement
body: <p>I've got a table and I want a query that returns the last 10 records created plus the record who's id is x.</p>
  
  <p>I'm trying to do - </p>
  
  <pre><code>SELECT * FROM catalog_productimage
  ORDER BY date_modified
  LIMIT 10
  UNION
  SELECT * FROM catalog_productimage
  WHERE id=5;
  </code></pre>
  
  <p>But it doesn't look like I can put <code>LIMIT</code> in there before <code>UNION</code>. I've tried adding another column and using it for sorting -</p>
  
  <pre><code>SELECT id, date_modified, IF(false, 1, 0) as priority FROM catalog_productimage
  UNION
  SELECT, id, date_modified, IF(true, 1, 0) as priority FROM catalog_productimage
  WHERE id=5
  ORDER BY priority, date_modified
  LIMIT 10;
  </code></pre>
  
  <p>but I'm not making much progress..</p>