Joins and Other Multiple-Dataset Operations
You can work with multiple datasets in a RAQL query using any of the following operations:
Join: Merge Columns for Dataset Rows to perform
inner joins that combine columns from two or more datasets into the result for rows that match a specific condition. You can also perform natural joins, cross joins or outer joins, if needed.
Union: Append Like Datasets to add the rows from two or more datasets into a larger result. The columns and datatypes of all datasets must be identical.
The basic query technique to work with multiple datasets uses a separate subquery for each dataset in the following form. This does not apply to join operations.
subquery-one [ UNION | INTERSECT | EXCEPT | MINUS] subquery-two [... optional additional multi-set operators and additional subqueries ...]
The individual subqueries for each dataset follow the same syntax and rules as usual, with one addition. You may need to include both the dataset and column names in the form
dataset-name.column-name to clearly identify a column. (See
Valid Names for Datasets, Columns, Aliases, Paths and Functions for more information.)
With Join, this basic query technique is applied within the From clause instead, such as:
SELECT columns-expression FROM subquery-one [ JOIN] subquery-two [... optional multi-set operator and subqueries ...] WHERE join-condition