SELECT MIN(ID), DATE FROM TABLE_NAME GROUP BY DATE;
Sql sorting date how to [closed]
Question
This is my current table:
+---+----------+
| id| date |
+---+----------+
| 1 |2014-05-05|
+---+----------+
| 2 |2014-05-06|
+---+----------+
| 3 |2014-05-06|
+---+----------+
| 4 |2014-05-07|
+---+----------+
| 5 |2014-05-07|
+---+----------+
| 6 |2014-05-07|
+---+----------+
These are the results I'm looking for:
+---+----------+
| id| date |
+---+----------+
| 1 |2014-05-05|
+---+----------+
| 2 |2014-05-06|
+---+----------+
| 4 |2014-05-07|
+---+----------+
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow