我有一個表,看起來像這樣獲取導致間隔一小時
+--------------------+-------+
| Date/Time | Value |
+--------------------+-------+
| 2014-01-01 8:30:10 | 10 |
| 2014-01-01 8:30:05 | 11 |
| 2014-01-01 7:15:04 | 24 |
| 2014-01-01 7:00:01 | 15 |
| 2014-01-01 6:55:20 | 06 |
| 2014-01-01 6:30:10 | 38 |
+--------------------+-------+
而且我想那一天小時間隔,但在價值觀,我應該怎麼辦呢? 我想要的結果是這樣的:
+--------------------+-------+
| Date/Time | Value |
+--------------------+-------+
| 2014-01-01 8:30:10 | 10 |
| 2014-01-01 7:15:04 | 24 |
| 2014-01-01 6:55:20 | 06 |
+--------------------+-------+
所以你要每小時最新一排? – Strawberry
@Strawberry是 – hearmeroar
http://stackoverflow.com/questions/6137024/mysql-how-to-group-data-per-hour-and-get-the-latest-hour – user1844933