Updated on 2024-05-14 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

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 return function, the sorting of the set return function column is not ignored.

5

Joins

Supported, with differences.

GaussDB supports only the same join types as Oracle, 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.

-