IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Comparison Operators
editComparison Operators
editThis functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
Boolean operator for comparing against one or multiple expressions.
-
Equality (
=
)
SELECT last_name l FROM "test_emp" WHERE emp_no = 10000 LIMIT 5;
-
Inequality (
<>
or!=
or<=>
)
SELECT last_name l FROM "test_emp" WHERE emp_no <> 10000 ORDER BY emp_no LIMIT 5;
-
Comparison (
<
,<=
,>
,>=
)
SELECT last_name l FROM "test_emp" WHERE emp_no < 10003 ORDER BY emp_no LIMIT 5;
-
BETWEEN
SELECT last_name l FROM "test_emp" WHERE emp_no BETWEEN 9990 AND 10003 ORDER BY emp_no;
-
IS NULL
/IS NOT NULL
SELECT last_name l FROM "test_emp" WHERE emp_no IS NOT NULL AND gender IS NULL;
-
IN (<value1>, <value2>, ...)
SELECT last_name l FROM "test_emp" WHERE emp_no IN (10000, 10001, 10002, 999) ORDER BY emp_no LIMIT 5;