Operators
The following operators are supported by Opteryx. Click a name for details.
Binary
Bitwise
Comparison
- Array contains all
@>> - Array contains any
@> - JSON path exists
@? - Equals
= - Greater than
> - Greater than or equal
>= - Case-insensitive like
ILIKE - IP contained by
<<= - IP contains
>>= - In list
IN - Like
LIKE - Less than
< - Less than or equal
<= - Not equals
!= - Not case-insensitive like
NOT ILIKE - Not in list
NOT IN - Not like
NOT LIKE - Not regex like
NOT RLIKE - Regex like
RLIKE
Extraction
Logical
Operator precedence
When an expression is written without parentheses, operators higher in this list bind first. Operators on the same line bind equally and group left to right, so a - b + c is (a - b) + c. A prefix operator applies to everything that binds tighter than it: NOT a = b is NOT (a = b), and -a * b is (-a) * b. Parentheses always override.
Some of these differ from other SQL engines; where they do, the line says so.
@>>->@>@?->>— Opteryx's own choice, above::and[]:payload->>'id'::INTEGERcasts the extracted value, anda->'b'[1]indexes the extracted value. Postgres binds::tighter and casts the key. A cast on a containment operand regroups too:a @> ['x']::ARRAY<VARCHAR>is(a @> ['x'])::ARRAY<VARCHAR>.[]::- unary
-unary+ /%*DIV||—||binds like*. Postgres puts||below+and-; the two only meet in an expression that mixes strings and numbers.-+&^<<=>>=<<>>—^,<<and>>share one tier, between&and|. MySQL binds^above*and the shifts above&, soa & b << cis(a & b) << chere anda & (b << c)in MySQL. The IPv4 containment operators<<=and>>=begin with the shift tokens and bind at this tier, not as comparisons.|=>>=IN<<=!=<>NOT INBETWEENNOT BETWEENILIKELIKENOT ILIKENOT LIKENOT RLIKERLIKESIMILAR TONOT SIMILAR TO— Pattern matching binds LOOSER than comparison. Postgres has it tighter, soa = b LIKE cis(a = b) LIKE chere anda = (b LIKE c)there.IS FALSEIS JSON ARRAYIS JSON OBJECTIS JSON SCALARIS JSONIS NOT FALSEIS NOT JSON ARRAYIS NOT JSON OBJECTIS NOT JSON SCALARIS NOT JSONIS NOT NULLIS NOT TRUEIS NULLIS TRUEIS DISTINCT FROMIS NOT DISTINCT FROM- unary
NOT ANDXOROR