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 order by crt_time desc limit 1) -- sub query, 循环若干次，若干=a的记录数。取出最后一个VALUE。 from a limit 1000000000 -- 这个不加的话有点问题，可能是个BUG，已反馈给社区。 ) t where (t.b).aid is not null; --