title: Select records with more populated fields
body: <p>I have 2 records in my database like so:</p>
  
  <pre><code>id | name      | photos
  
  1  | test name | http://www.photo.com/1.jpg
  
  2  | test name | null
  </code></pre>
  
  <p>These 2 records are the same except 1 has a photo and the other one does not.  I can de-dupe this while doing a select with the following query:</p>
  
  <pre><code>SELECT * FROM table WHERE name = 'test name' GROUP BY name;
  </code></pre>
  
  <p>This gives me 1 single record but I want to return the row WITH a photo.  What can I do to this query to achieve that?</p>
  
  <p>Note: I can not just assume that at least 1 of the duplicates will have photos. Sometimes they both might be null so I can not use:</p>
  
  <pre><code>SELECT * FROM table WHERE name = 'test name' AND photos IS NOT NULL GROUP BY name;
  </code></pre>