1
0
forked from docs/doc-exports
doc-exports/docs/dli/sqlreference/dli_08_0169.html
Su, Xiaomeng 04d4597cf3 dli_sqlreference_0511_version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2023-11-02 14:34:08 +00:00

3.9 KiB

FULL OUTER JOIN

Function

Join all records from the right table and the left table and return all joined records. If no joined record is found, NULL will be returned.

Syntax

1
2
SELECT attr_expr_list FROM table_reference
  FULL OUTER JOIN table_reference ON join_condition;

Keyword

FULL OUTER JOIN: Matches all records in the left and right tables. If no record is matched, NULL is returned.

Precautions

The to-be-joined table must exist. Otherwise, an error is reported.

Example

To join all records from the right table and the left table and return all joined records, run the following statement. If no joined record is found, NULL will be returned.

1
2
SELECT student_info.name, course_info.courseName FROM student_info
  FULL OUTER JOIN course_info ON (student_info.courseId = course_info.courseId);