title: MySQL select max date or null date
body: <p>I would to select the max date or null but it shows a error message.  </p>
  
  <blockquote>
    <p>Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=IS;, CASE WHEN MAX(DATE;CONCAT, DRIVER=3.64.114</p>
  </blockquote>
  
  <p>The original table is </p>
  
  <pre><code>Employee code           resignation date
  001                     1/2/2013
  001                     1/5/2014
  001                     null
  002                     10/10/2000
  </code></pre>
  
  <p>should be show</p>
  
  <pre><code>EMPLOYEE_CODE           RESIGNATION_DATE
  001                     null
  002                     10/10/2000
  </code></pre>
  
  <p>this is my query</p>
  
  <pre><code>SELECT EMPLOYEE_CODE, 
         CASE 
             WHEN MAX(RESIGNATION_DATE IS NULL)= 0 
             THEN MAX(RESIGNATION_DATE) 
         END AS DATE
  FROM MT_EMPLOYEE_CONTRACT
  GROUP BY EMPLOYEE_CODE;
  </code></pre>
  
  <p>Can Anyone find out what is the problem?
  Thank you</p>