桌子:
+------------+------------------+
| Number | Date |
+------------+------------------+
| 1 | 1900-01-01 |
| 1 | 2012-01-01 |
| 1 | 2011-01-01 |
| 2 | 1900-01-01 |
| 2 | 2007-01-01 |
+------------+------------------+
结果需要是:
+------------+------------+
| Number | Date |
+------------+------------+
| 1 | 2012-01-01 |
| 2 | 2007-01-01 |
+------------+------------+
等等...
编辑 -
桌子:
+------------+------------------+------------+
| Number | Date | Field3 |
+------------+------------------+------------+
| 1 | 1900-01-01 | a |
| 1 | 2012-01-01 | b |
| 1 | 2011-01-01 | c |
| 2 | 1900-01-01 | a |
| 2 | 2007-01-01 | b |
+------------+------------------+------------+
我想在 GROUP 的日期 = MAX 时选择 DISTINCT 数字。
所以在查询之后我会得到:
1...b
2...b