Skip to main content
NQL supports standard SQL operators for comparisons, logic, arithmetic, and pattern matching.

Comparison operators

Compare two values and return a boolean result.

Examples

Comparisons involving NULL return NULL, not true or false. Use IS NULL or IS NOT NULL for NULL checks.

Logical operators

Combine boolean expressions.

Operator precedence

NOT is evaluated before AND, which is evaluated before OR. Use parentheses for clarity:

Examples


Arithmetic operators

Perform mathematical calculations on numeric values.

Examples

Division by zero returns NULL in NQL. Consider using NULLIF to handle potential zero divisors: total / NULLIF(count, 0)

String operators

Concatenation

The || operator concatenates strings:
Non-string values are implicitly converted to strings:

IN and NOT IN

Test membership in a set of values.

Syntax

Examples

IN with subquery

For large value lists, consider using a JOIN instead of IN for better performance.

BETWEEN

Test if a value falls within a range (inclusive).

Syntax

Equivalent to:

Examples


NULL operators

IS NULL / IS NOT NULL

Test for NULL values. Regular comparison operators don’t work with NULL.

Examples

IS DISTINCT FROM / IS NOT DISTINCT FROM

NULL-safe equality comparison. Treats NULL as a comparable value.

Pattern matching

LIKE

Match string patterns using wildcards.

Case sensitivity

LIKE is case-sensitive. Use UPPER or LOWER for case-insensitive matching:

NOT LIKE


Interval operators

Perform date and time arithmetic using intervals.

Syntax

Supported units

Examples

Combining with date functions


Operator precedence

From highest to lowest precedence:

Using parentheses

Use parentheses to override default precedence or improve readability:

NQL Syntax

Query structure and grammar reference

Data Types

Type system and conversions

Functions

Built-in functions for data manipulation

Filtering Data

Guide to writing effective WHERE clauses