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
String operators
Concatenation
The|| operator concatenates 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
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. UseUPPER 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:Related content
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

