【发布时间】:2012-03-16 07:26:31
【问题描述】:
我有一张经常更新的 AIS 海洋数据表。
我需要的是过去 30 分钟的数据,并且从该结果中最新的行和 MMSI 应该是唯一的。
我现在的查询:
select max(timestamp) as timestamp, mmsi, navstatus, rot, sog, lon, lat, cog,
thead, man, mtype from ais_cnb
where (timestamp > (now() - interval 30 minute))
group by mmsi
order by timestamp desc
似乎除了时间戳之外的所有数据都是旧的。
【问题讨论】:
-
this 链接一定会帮助你...
-
@FahimParkar Parkar:这个链接对我有什么帮助?