title: SQL Syntax on DISTINCT Query
body: <p>I have an Employee Table with their DeptCode. I want list of distinct DeptCode and their first created date in the Employee Table. This will also tell which employee was first entered for a specific dept in the Employee Table.</p>
  
  <p>I used:</p>
  
  <pre><code>SELECT DISTINCT DEPTCODE, 
                  CREATEDDATE 
  FROM   EMPLOYEE 
  </code></pre>
  
  <p>The Date Return is incorrect.</p>
  
  <p>Any specific syntax to handle this issue.</p>