【发布时间】:2021-09-22 07:26:33
【问题描述】:
以下是一些数据
现在我想只检索那些具有唯一 current_position_latitude 和 current_position_longitude 和 top 记录的记录,方法是使用 sys_movement_evt_id 的 order by。这低于我需要的输出。
我当前的查询是
select
CURRENT_POSITION_LATITUDE,
CURRENT_POSITION_LONGITUDE,
SYS_EVT_TARGET_ID,
SYS_MOVEMENT_EVT_ID
from TMS_MOVEMENT_EVT
where SYS_EVT_TARGET_ID = 10245 and
CURRENT_POSITION_LATITUDE is not null and CURRENT_POSITION_LATITUDE != 0 and
CURRENT_POSITION_LONGITUDE is not null and CURRENT_POSITION_LONGITUDE != 0
请告诉我如何实现所需的输出。
【问题讨论】:
标签: sql oracle oracle11g greatest-n-per-group