我的項目,那我需要做的事情之一工作的一個最新值,是選擇一些數據創建SQL查詢來獲取每個UNIT_ID
表:
id | unit_id | data1 | data2 | data 3 | data4 | TimeStamp
1 | 1 | 1 | 1 | 1 | 2012-10-18 18:17:42
2 | 1 | 2 | 2 | 2 | 2012-10-18 18:18:42
3 | 1 | 3 | 5 | 3 | 2012-10-20 18:19:42
4 | 1 | 4 | 7 | 4 | 2012-10-21 18:20:42
5 | 1 | 5 | 8 | 8 | 2012-10-22 18:21:42
6 | 2 | 1 | 1 | 1 | 2012-10-18 18:17:42
7 | 2 | 2 | 2 | 4 | 2012-10-19 18:18:42
8 | 2 | 3 | 2 | 5 | 2012-10-20 18:19:42
9 | 2 | 4 | 3 | 6 | 2012-10-21 18:20:42
,我需要什麼,是讓Single LATEST value for EACH unit_id