title: Select distinct column along with some other columns in MySQL
body: <p>I can't seem to find a suitable solution for the following (probably an age old) problem so hoping someone can shed some light. I need to return 1 distinct column along with other non distinct columns in mySQL.</p>
  
  <p>I have the following table in mySQL:</p>
  
  <pre><code>id      name       destination     rating     country
  ----------------------------------------------------
  1       James      Barbados        5          WI
  2       Andrew     Antigua         6          WI
  3       James      Barbados        3          WI
  4       Declan     Trinidad        2          WI
  5       Steve      Barbados        4          WI
  6       Declan     Trinidad        3          WI
  </code></pre>
  
  <p>I would like SQL statement to return the DISTINCT name along with the destination, rating based on country.</p>
  
  <pre><code>id      name       destination     rating     country
  ----------------------------------------------------
  1       James      Barbados        5          WI
  2       Andrew     Antigua         6          WI
  4       Declan     Trinidad        2          WI
  5       Steve      Barbados        4          WI
  </code></pre>
  
  <p>As you can see, James and Declan have different ratings, but the same name, so they are returned only once. </p>
  
  <p>The following query returns all rows because the ratings are different. Is there anyway I can return the above result set?</p>
  
  <pre><code>SELECT (distinct name), destination, rating 
    FROM table 
   WHERE country = 'WI' 
   ORDER BY id
  </code></pre>