postgresql 抽样查询

curl -GET 'http://****/query' --data-urlencode "db=db" --data-urlencode "q=SELECT last(reg_value) FROM  **table**  WHERE device_id='20528' and reg_addr='2061' and time>='2016-09-18 10:02:00' and time<='2016-09-18 11:02:00' group by time(5m) fill(previous) ;"

原文地址:https://www.cnblogs.com/oxspirt/p/5946343.html