Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
118 views
in Technique[技术] by (71.8m points)

sql - SELECT data from hypertable

In partioned table I have 4 columns

itemid|clock     |value                |ns       
------|----------|---------------------|---------
 29823|1611360003|   1.4276002719238614|687885596
 23664|1611360024|   0.0846740050804403|691887511
 23252|1611360032|                  0.0|693202596
 23253|1611360033|  0.23664638269100743|693582940

Table has these partitions enter image description here

How I can take hypertable table name using SELECT by clock? Clock field stores data in unixtime but SELECT should be in datetime

All partitions can be extracted using this query

SELECT public.show_chunks('history');
show_chunks
_timescaledb_internal._hyper_1_2_chunk
_timescaledb_internal._hyper_1_5_chunk
_timescaledb_internal._hyper_1_7_chunk
_timescaledb_internal._hyper_1_9_chunk
_timescaledb_internal._hyper_1_11_chunk
question from:https://stackoverflow.com/questions/65903401/select-data-from-hypertable

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...