title: How consider NULL as the MAX date instead of ignoring it in MySQL?
body: <p>Lets say that I have a table named test like this:</p>
  
  <pre><code>ID   DATE     
  
  1     '2013-01-26'
  1     NULL
  1     '2013-03-03'      
  2     '2013-02-23'      
  2     '2013-04-12'      
  2     '2013-05-02'   
  </code></pre>
  
  <p>And I would like to get from this table :</p>
  
  <pre><code>ID   DATE     
  
  1     NULL    
  2     '2013-05-02'   
  </code></pre>
  
  <p>Here is my query:</p>
  
  <pre><code>select ID, max(DATE)
  from test
  group by ID
  </code></pre>
  
  <p>Problem is that MYSQL ignores NULL values and returns me</p>
  
  <pre><code>ID   DATE     
  
  1     '2013-03-03'   
  2     '2013-05-02' 
  </code></pre>
  
  <p>How can i do so when there is a NULL it takes the MAX as NULL?</p>