title: SQL: DISTINCT not working with cursor
body: <p>Am facing issues with sql query Its not returning the distinct values,
  <br>Having sql query as below mentioned </p>
  
  <pre><code>SELECT DISTINCT m.Firstname, m.Secondname, m.creation_date, 
       CURSOR (SELECT DISTINCT o.Certifications, o.Country FROM OtherTable o 
       WHERE o.OtherTable_ID = m.MainTable_ID ) details 
  FROM MainTable m 
  WHERE m.Manager_ID = 100
  </code></pre>
  
  <p>Here <code>Maintable</code> has 20 records for a respective manager (100), but only one record available for below mentioned columns.</p>
  
  <pre><code>SELECT DISTINCT 
      m.Firstname, m.Secondname, m.creation_date 
  FROM 
      MainTable m 
  WHERE 
      m.Manager_ID = 100
  </code></pre>
  
  <p>But when I executed with cursor it returning all 20 rows, without consideration of distinct.</p>
  
  <p>I tried with below query, but need above mentioned format.</p>
  
  <pre><code>SELECT DISTINCT 
      m.Firstname, m.Secondname, m.creation_date, o.Certifications, o.Country 
  FROM 
      MainTable m 
  LEFT JOIN 
      OtherTable o  ON o.OtherTable_ID = m.MainTable_ID
  WHERE 
      m.Manager_ID = 100
  </code></pre>
  
  <p>Could you please let us know, how could we achieve this? </p>