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|
+---+----------+
Was it helpful?

Solution

SELECT MIN(ID), DATE FROM TABLE_NAME GROUP BY DATE;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top