title: How do I remove duplicates in an SQL query without using Distinct?
body: <p>There are duplicates in the results of the query below. My question is how to get rid of <code>subTaskName</code> duplicates without using <code>distinct</code>? </p>
  
  <pre><code>SELECT  tasks.priority, (SELECT tasks.name FROM tasks WHERE tasks.taskid ='11377') AS taskName,
          tasks.name AS subTaskName,u.name,tasks.deadline,tasks.created,a.duration AS durata,tasks.parentID,tasks.userid ,tasks.finished,
          tasks.estimated,tasks.taskid,tasks.section,tasks.tags
          FROM tasks 
          INNER JOIN users u 
          ON tasks.assignerid = u.userid
          INNER JOIN activities a 
          ON tasks.parentID = a.taskid
          WHERE tasks.parentID='11377' 
          ORDER BY tasks.taskid
          DESC
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/zLmvW.png" rel="nofollow">Use this link to see the image</a> </p>