什么是高级?这就叫高级—openGauss(10)

37 阅读1分钟

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/

右外连接

右外连接与左外连接类似,只是关键字右端表中的所有元组都列出,限制左端表的数据必须满足连接条件,而右端表中的数据无论是否满足连接条件,均输出表中的内容。

右外连接查询语句的关键字为RIGHT OUTER JOIN。

示例:

css 代码解读复制代码openGauss=# SELECT * FROM table1 a RIGHT OUTER JOIN table2 b ON a.name = b.name;
 name  | city | id | name  | dept
-------+------+----+-------+-------
 Lily  | BJ   |  2 | Lily  | IT
 Grace | SZ   |  4 | Grace | IT
       |      |  3 | Li    | sales
       |      |  1 | Tommy | IT
(4 rows)

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/