Programming, Alibaba Cloud, Database, Postgresql, Data Analytics.
(analyze,verbose,timing,costs,buffers) select (t.b).aid,(t.b).val,(t.b).crt_time from ( select ( select b from b where b.aid=a.id and b.crt_time between '2017-07-17 09:53:00.480416' and '2017-07-17 09:54:00.480416' -- 限定时间区间 order by crt_time desc limit 1 ) -- sub query, 循环若干次，若干=a的记录数。取出最后一个VALUE。