InfluxQL中WHERE时间条件查询无返回结果问题排查
Ah, I spot the issue immediately — your query has a critical logical error in the time range condition, which is why it returns no results.
Let’s look at your WHERE clause:
WHERE time > '2016-05-30' and time < '2015-05-31'
You’ve reversed the order of your time bounds: 2016-05-30 is chronologically later than 2015-05-31. This condition asks for timestamps that are both after a later date and before an earlier date — a logical impossibility, so no data can ever match this filter.
Fixed Query Options
If your goal was to query data between 2015-05-30 and 2015-05-31 (matching your first successful query’s date range), adjust the time bounds to follow chronological order:
select "P_askbid_midprice1" from "/HFT/Data_HFT/OrderBook/DCIX_OB" WHERE time >= '2015-05-30' and time < '2015-05-31' limit 50
If you intended to query 2016 data instead, update the upper bound to match the later year:
select "P_askbid_midprice1" from "/HFT/Data_HFT/OrderBook/DCIX_OB" WHERE time > '2016-05-30' and time < '2016-05-31' limit 50
A quick reminder: InfluxQL’s time comparisons rely on standard chronological logic — always ensure your start time is earlier than your end time, otherwise your filter will resolve to an empty set.
内容的提问来源于stack exchange,提问作者Jeremie

