title: Select DISTINCT rows of multiple columns in mysql
body: <p>I have a table called <code>sk_messages</code>.It's structure is like the following:</p>
  
  <pre><code>msg_id     msg_from_user_id  msg_to_user_id  msg_text   msg_date     msg_status  
  
   1              12                14          hai...   23-12-2013      unread
  
   2              12                14         ....     ...             unread
  
   3              13                 14        ...      ..               unread
  </code></pre>
  
  <p>My requirement is that I want to display all messages which are for the current user with a condition that single message should be displayed from a sender even if he sends multiple messages with the status unread.That is,from the above context, single message of the user having ID 12, should be displayed.I have tried the following query,but it doesnt work.</p>
  
  <pre><code>SELECT DISTINCT (msg_from_user_id), msg_text, msg_date
   FROM sk_messages
   WHERE msg_to_user_id =  '$user_id'
   AND msg_status =  'unread'
   ORDER BY msg_date
  
  
  $user_id is the id of the login user
  </code></pre>