Operators
Calculate values and combine comparisons in expressions.
Try an expression
In Formula, enter the expression and set Output type to INTEGER.
Example input
- Row 1
price = 5, qty = 2 - Row 2
price = 10, qty = 3 - Row 3
price = NULL, qty = 2
Expression
price * qtyResult
Row 1: 10
Row 2: 30
Row 3: NULLNULL means the value is missing.
Arguments and types
a + b, a % b, a = b, a AND b, a || b, a IN (...)The result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
Use a % b or mod(a, b) to get the remainder after division. For example, 7 % 3 returns 1.
Combine comparisons
For this example, set Output type to BOOLEAN.
price > 5 AND qty >= 2Row 1: false Row 2: true Row 3: NULL
Match one of several values
For this example, set Output type to BOOLEAN.
price IN (5, 10)Row 1: true Row 2: true Row 3: NULL
Join text
For this example, set Output type to VARCHAR.
CAST(price AS VARCHAR) || ' units'Row 1: '5 units' Row 2: '10 units' Row 3: NULL
Function metadata from DuckDB, used under the MIT license.