select
a.serial_station_status
from
station_realtime a,
(select customer_id,max(station_scaned_index) from idcora.station_realtime group by customer_id) b
WHERE a.customer_id=b.customer_id;
a.serial_station_status
from
station_realtime a,
(select customer_id,max(station_scaned_index) from idcora.station_realtime group by customer_id) b
WHERE a.customer_id=b.customer_id;
(select t.*,rank() over(partition by customer_id order by station_scaned_index desc) rk
from station_realtime t) tt
where rk=1;
select serial_station_status from station_realtime
WHERE (customer_id,station_scaned_index) IN
(select customer_id,max(station_scaned_index) from idcora.station_realtime group by customer_id);
a.serial_station_status
from
station_realtime a,
(select customer_id,max(station_scaned_index) station_scaned_index
from idcora.station_realtime group by customer_id) b
WHERE a.customer_id=b.customer_id and and
a.station_scaned_index=b.station_scaned_index;
顶 bzszp的