The AND operand returns true if both operands are true. Otherwise, it returns false.
This operator is typically used in the WHERE clause
to combine multiple conditions.
SELECTtrueANDfalseAS"AND condition"
AND condition
false
Examples
AND operator in the WHERE clause
SELECT*FROMhomeWHEREco>10ANDroom='Kitchen'
co
hum
room
temp
time
18
36.9
Kitchen
23.3
2022-01-01T18:00:00Z
22
36.6
Kitchen
23.1
2022-01-01T19:00:00Z
26
36.5
Kitchen
22.7
2022-01-01T20:00:00Z
BETWEEN
The BETWEEN operator returns true if the left numeric operand is within the
range specified in the right operand. Otherwise, it returns false
SELECT6BETWEEN5AND8AS"BETWEEN condition"
BETWEEN condition
true
Examples
BETWEEN operator in the WHERE clause
SELECT*FROMhomeWHEREcoBETWEEN5AND10
co
hum
room
temp
time
7
36
Kitchen
22.4
2022-01-01T16:00:00Z
9
36
Kitchen
22.7
2022-01-01T17:00:00Z
5
35.9
Living Room
22.6
2022-01-01T17:00:00Z
9
36.2
Living Room
22.8
2022-01-01T18:00:00Z
EXISTS
The EXISTS operator returns true if result of a
correlated subquery
is not empty. Otherwise it returns false.
The LIKE operator returns true if the left operand matches the string pattern
specified in the right operand.
LIKE expressions support SQL wildcard characters.
SELECT'John'LIKE'J_%n'AS"LIKE condition"
LIKE condition
true
LIKE operator in the WHERE clause
SELECT*FROMhomeWHEREroomLIKE'%Room'LIMIT4
co
hum
room
temp
time
0
35.9
Living Room
21.1
2022-01-01T08:00:00Z
0
35.9
Living Room
21.4
2022-01-01T09:00:00Z
0
36
Living Room
21.8
2022-01-01T10:00:00Z
0
36
Living Room
22.2
2022-01-01T11:00:00Z
SQL wildcard characters
The InfluxDB SQL implementation supports the following wildcard characters when
using the LIKE operator to match strings to a pattern.
Character
Description
%
Represents zero or more characters
_
Represents any single character
NOT
The NOT operator negates the subsequent expression.
The OR operator returns true if any operand is true.
Otherwise, it returns false.
This operator is typically used in the WHERE clause
to combine multiple conditions.
Thank you for being part of our community!
We welcome and encourage your feedback and bug reports for InfluxDB and this documentation.
To find support, use the following resources:
InfluxDB v3 enhancements and InfluxDB Clustered is now generally available
New capabilities, including faster query performance and management
tooling advance the InfluxDB v3 product line.
InfluxDB Clustered is now generally available.
InfluxDB v3 performance and features
The InfluxDB v3 product line has seen significant enhancements in query
performance and has made new management tooling available. These enhancements
include an operational dashboard to monitor the health of your InfluxDB cluster,
single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management
APIs for tokens and databases.