Arithmetic
Standard arithmetic with conventional precedence (*, /, % before +, -):
Bitwise Operators
String Concatenation
Use|| to concatenate strings:
CASE
Searched form — eachWHEN is a full condition:
COALESCE
Returns the first non-NULL argument:NULLIF
Returns NULL if both arguments are equal; otherwise returns the first argument:ISNULL
Returnstrue if the argument is NULL, false otherwise. Equivalent to IS NULL in a predicate context:
Expression Aliases in ORDER BY
Aliases defined inSELECT can be used in ORDER BY:
Literals
| Type | Example |
|---|---|
| Integer | 42, -7 |
| Decimal | 3.14, -0.5 |
| String | 'hello', 'it''s' (doubled single quote) |
| Boolean | TRUE, FALSE |
| NULL | NULL |
Not Supported
CAST/CONVERTDATE,TIME,TIMESTAMPliterals- Scientific notation literals (e.g.,
1e3) - Hex string literals (
X'0A') - Bit string literals (
B'0101')