Functions and Operators

On this page Carat arrow pointing down
Warning:
As of April 12, 2019, CockroachDB v1.1 is no longer supported. For more details, refer to the Release Support Policy.

CockroachDB supports the following SQL functions and operators.

Tip:
In the built-in SQL shell, use \hf [function] to get inline help about a specific function.

Built-in Functions

404: Not Found

Aggregate Functions

404: Not Found

Operators

The following table lists all CockroachDB operators from highest to lowest precedence, i.e., the order in which they will be evaluated within a statement. Operators with the same precedence are left associative. This means that those operators are grouped together starting from the left and moving right.

Order of Precedence Operator Name Operator Arity
1 . Member field access operator binary
2 :: Type cast binary
3 - Unary minus unary
~ Bitwise not unary
4 ^ Exponentiation binary
5 * Multiplication binary
/ Division binary
// Floor division binary
% Modulo binary
6 + Addition binary
- Subtraction binary
7 << Bitwise left-shift binary
>> Bitwise right-shift binary
8 & Bitwise and binary
9 # Bitwise xor binary
10 | Bitwise or binary
11 || Concatenation binary
12 [NOT] BETWEEN Value is [not] within the range specified binary
[NOT] IN Value is [not] in the set of values specified binary
[NOT] LIKE Matches [or not] LIKE expression, case sensitive binary
[NOT] ILIKE Matches [or not] LIKE expression, case insensitive binary
[NOT] SIMILAR Matches [or not] SIMILAR TO regular expression binary
~ Matches regular expression, case sensitive binary
!~ Does not match regular expression, case sensitive binary
~* Matches regular expression, case insensitive binary
!~* Does not match regular expression, case insensitive binary
13 = Equal binary
< Less than binary
> Greater than binary
<= Less than or equal to binary
>= Greater than or equal to binary
!=, <> Not equal binary
14 IS Value identity binary
15 NOT Logical NOT unary
16 AND Logical AND binary
17 OR Logical OR binary

Supported Operations

404: Not Found


Yes No
On this page

Yes No