Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

select from InfluxDB where value is null

Tags:

influxdb

If my data (conceptually) is:

#  a b c 
  -------
1  1   1
2  1 1 0
3  1 0 1

Then in legacy SQL language, the statement would be:

select * from table where b is null

I cannot find a similar condition within the InfluxDB Query Language documentation.

I am working with data where there is optionally a numeric value in a column, and I want to select records where this column is empty/null. Since these are integers, they appear not to work with the matching regexes at all, so something like where !~ /.*/ is out.

like image 909
glasnt Avatar asked May 07 '15 04:05

glasnt


2 Answers

InfluxDB doesn' understand NULL and will show error if use is null or is not null in the query. In order to find something which is like null we need to look for empty space i.e. use empty single quotes as

SELECT * FROM service_detail where username != ''
like image 121
Avis Avatar answered Sep 28 '22 02:09

Avis


You cannot search for nulls in InfluxDB <0.9. You will not be able to insert nulls in Influx >=0.9

like image 37
glasnt Avatar answered Sep 28 '22 00:09

glasnt