SQL - How to order by min date
<p>I have a table with logs</p>

<pre><code>PERSON ID             LOGDATE (DATETIME)
  1000                2015-10-20 10:00:00
  1000                2015-11-11 09:10:22
  2001                2015-10-11 10:22:11
</code></pre>

<p>I need to order the data by LOGDATE -DATETIME - but with only the lowest date for each ID.</p>

<pre><code>select PERSONALID, LOGDATE from TABLE   group by PERSONALID order by
MIN(LOGDATE) DESC
</code></pre>

<p>I can GROUP by ID - ORDER BY Min DATE (each result by ID), but THE FINAL RESULT doesnt order the results by MIN DATE..</p>

<pre><code>RESULT:
1000 ------------- 2015-10-20 10:00:00 (min date for ID=1000)
2001 ------------- 2015-10-11 10:22:11 (min date for ID=2001)
</code></pre>

<p>the right answer is:</p>

<pre><code>RESULT:
2001 ------------- 2015-10-11 10:22:11 (min date for ID=2001)
1000 ------------- 2015-10-20 10:00:00 (min date for ID=1000)
</code></pre>

<p>what is wrong?</p>