选择一天中最大记录
Ricky
posted @ 2015年7月02日 11:33
in Other
, 970 阅读
select s1.*
from sensorTable s1
inner join
(
SELECT sensorID, max(timestamp) as mts
FROM sensorTable
GROUP BY sensorID
) s2 on s2.sensorID = s1.sensorID and s1.timestamp = s2.mts