Jeremie
Jeremie

Reputation: 435

WHERE command is not working

In using Influxql, when I try the following command

select "P_askbid_midprice1" from "/HFT/Data_HFT/OrderBook/DCIX_OB" limit 50

I got the following result

name: /HFT/Data_HFT/OrderBook/DCIX_OB
time                 P_askbid_midprice1
----                 ------------------
2015-05-30T00:00:00Z 0
2015-05-30T00:00:01Z 0
2015-05-30T00:00:02Z 0
2015-05-30T00:00:03Z 0
2015-05-30T00:00:04Z 0
2015-05-30T00:00:05Z 0
2015-05-30T00:00:06Z 0
2015-05-30T00:00:07Z 0
2015-05-30T00:00:08Z 0
2015-05-30T00:00:09Z 0
2015-05-30T00:00:10Z 0
2015-05-30T00:00:11Z 0
2015-05-30T00:00:12Z 0
2015-05-30T00:00:13Z 0
2015-05-30T00:00:14Z 0
2015-05-30T00:00:15Z 0
2015-05-30T00:00:16Z 0
2015-05-30T00:00:17Z 0
2015-05-30T00:00:18Z 0
2015-05-30T00:00:19Z 0
2015-05-30T00:00:20Z 0
2015-05-30T00:00:21Z 0
2015-05-30T00:00:22Z 0
2015-05-30T00:00:23Z 0
2015-05-30T00:00:24Z 0
2015-05-30T00:00:25Z 0
2015-05-30T00:00:26Z 0
2015-05-30T00:00:27Z 0
2015-05-30T00:00:28Z 0
2015-05-30T00:00:29Z 0
2015-05-30T00:00:30Z 0
2015-05-30T00:00:31Z 0
2015-05-30T00:00:32Z 0
2015-05-30T00:00:33Z 0
2015-05-30T00:00:34Z 0
2015-05-30T00:00:35Z 0
2015-05-30T00:00:36Z 0
2015-05-30T00:00:37Z 0
2015-05-30T00:00:38Z 0
2015-05-30T00:00:39Z 0
2015-05-30T00:00:40Z 0

But with the command

select "P_askbid_midprice1" from "/HFT/Data_HFT/OrderBook/DCIX_OB" WHERE time > '2016-05-30' and time < '2015-05-31'

I got nothing from that command even if it is pretty similar to the previous one.

What is the problem with that command?

Upvotes: 0

Views: 24

Answers (1)

RToyo
RToyo

Reputation: 2877

You need to use an or statement instead of an and statement. Time cannot be both "after" May 2016 and "before" May 2015. It has to be one or the other.

select "P_askbid_midprice1" 
from "/HFT/Data_HFT/OrderBook/DCIX_OB" 
WHERE 
    time > '2016-05-30' 
    or time < '2015-05-31'

Upvotes: 1

Related Questions