Programming, Alibaba Cloud, Database, Postgresql, Data Analytics.
by sid, crt_time desc limit 1 ) union all ( select (select t1 from sensor_stat AS t1 where t1.crt_time <= '2017-07-05 10:29:09' and t1.sid>(t.sensor_stat).sid order by sid, crt_time desc limit 1) from t where (t.sensor_stat).sid is not null ) ) select count(*) from t where t.* is not null and