Help Center/ GaussDB/ Oracle Compatibility(Centralized)/ SQL Queries and Subqueries
Updated on 2024-12-06 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

Supported, with differences.

GaussDB supports only Oracle Database's CONNECT_BY_FILTERING and does not support CONNECT_BY_NOFILTERING.

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 join types with Oracle Database, such as left/right, self, natural, and full outer join. Join optimization methods such as IN-MEMORY JOIN GROUP 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 needs to explicitly specify a database link for query.

9

Aggregate function nesting

Supported.

-