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|
+---+----------+
有帮助吗?

解决方案

SELECT MIN(ID), DATE FROM TABLE_NAME GROUP BY DATE;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top