present.md 751 B

% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.

Examples

FROM employees
| STATS is_present = PRESENT(languages)
is_present:boolean
true

To check for the presence inside a group use PRESENT() and BY clauses

FROM employees
| STATS is_present = PRESENT(salary) BY languages
is_present:boolean languages:integer
true 1
true 2
true 3
true 4
true 5
true null

To check for the presence and return 1 when it's true and 0 when it's false

FROM employees
| WHERE emp_no == 10020
| STATS is_present = TO_INTEGER(PRESENT(languages))
is_present:integer
0