Updated on 2024-11-11 GMT+08:00

SQL Queries and Subqueries

GaussDB is compatible with SQL queries and subqueries except hierarchical queries.

Table 1 SQL queries and subqueries

No.

Oracle Database

GaussDB

Difference

1

Creating simple queries

Supported.

-

2

Hierarchical queries

Not supported.

-

3

UNION [ALL], INTERSECT, MINUS

Supported.

-

4

Sorting query results

Supported, with differences.

If the GaussDB query does not contain groups and the target column contains both an aggregate function and a set returning function, the sorting of the set returning function column is not ignored.

5

Joins

Supported, with differences.

GaussDB supports only the same join types as Oracle Database, such as left/right, self, natural, and full outer join. Join optimization methods such as IN-MEMORY JOIN GROUPS are not supported.

6

Using subqueries

Supported.

-

7

Unnesting of nested subqueries

Supported, with differences.

HASH_AJ or MERGE_AJ cannot be explicitly specified in GaussDB.

8

Distributed queries

Supported, with differences.

GaussDB requires explicit database link query.

9

Aggregate function nesting

Supported.

-