Updated on 2024-05-14 GMT+08:00

Operators

GaussDB is basically compatible with Oracle operators.

SQL Operators

Table 1 SQL operators

No.

Oracle

GaussDB

1

Unary and binary operators

Supported.

2

Operator precedence

Supported.

Arithmetic Operators

Table 2 Arithmetic operators

No.

Oracle

GaussDB

1

Unary operators: positive (+) and negative (–).

Supported.

2

Binary operators: addition (+) and subtraction (–).

Supported.

3

Binary operators: multiplication (*) and division (/).

Supported.

COLLATE Operator

Table 3 COLLATE operator

No.

Oracle

GaussDB

1

COLLATE collation_name

Supported.

Connection Operators

Table 4 Connection operators

No.

Oracle

GaussDB

1

||

Supported.

Hierarchical Query Operators

Table 5 Hierarchical query operators

No.

Oracle

GaussDB

Difference

1

prior

Supported, with differences.

GaussDB: Only common columns can be called. Functions cannot be called.

2

connect_by_root

Supported, with differences.

GaussDB: When connect_by_root is called, if parentheses are used to modify the operation value, the behavior is the same as that of Oracle. If parentheses are not used, this operator can be called only for common columns.

Set Operators

Table 6 Set operators

No.

Oracle

GaussDB

1

union

Supported.

2

union all

Supported.

3

intersect

Supported.

4

minus

Supported.

Multiset Operators

Table 7 Multiset operators

No.

Oracle

GaussDB

1

multiset except

Supported.

2

multiset intersect

Supported.

3

multiset union

Supported.

User-defined Operators

Table 8 User-defined operators

No.

Oracle

GaussDB

Difference

1

CREATE OPERATOR

Supported, with differences.

  • Oracle provides CONTEXT_CLAUSE to define functional evaluation functions, which is different from GaussDB that constrains selectivity evaluation functions. GaussDB does not support user-defined functional evaluation functions.
  • Optional parameters in Oracle differ greatly from those in GaussDB. For details, see the GaussDB parameter description in "SQL Reference > SQL Syntax > C > CREATE OPERATOR" in Developer Guide.

Comparison Operators

No.

Oracle

GaussDB

1

< =

Supported.

2

< >

Supported.

3

> =

Supported.

4

^ =

Supported.

5

! =

Not supported. For !=, if there is a space between an exclamation mark (!) and an equal sign (=), the exclamation mark will be identified as factorial.

For comparison operators <=, <>, >=, and ^=, if there is a space between two symbols, it does not affect normal operations. For !=, if there is a space between an exclamation mark (!) and an equal sign (=), the exclamation mark will be identified as factorial, which may cause the result to be inconsistent with the expected result.