title: duplicate column name error in mysql query
body: <p>I get an error of dupicate column name if fromm my query and dont know how to solve my query is</p>
  
  <pre><code>SELECT distinct(courseid+senderid+recipientid) as diskey,
         mess.id,
         User.firstName as recipientName,
         Course.name,
         senderid,
         recipientid,
         courseid,
         message,
         mess.status,
         mess.createdOn 
  FROM 
  (
      SELECT * 
      from Message,User,Course 
      where Message.recipientid=User.id 
          and Message.courseid=Course.id 
      order by Message.createdOn DESC
  ) as mess,
       User,
       Course 
  WHERE senderid ='3' 
        OR recipientid='3' 
  GROUP BY diskey;    
  </code></pre>
  
  <p>can any one heplp </p>