(+)登录sql码
(+) sign in sql code
谁能解释一下下面代码中的 (+) 符号是什么意思。
SELECT DISTINCT ph.po_nbr, rd.id
FROM po_head a, rtable_dtl e
WHERE a.org = e.org (+)
AND a.menu_nbr = e.menu_nbr(+)
AND UPPER(a.user_id) = UPPER(e.user_id(+))
一个例子:
SELECT
t0.foo, t1.bar
FROM
FIRST_TABLE t0, SECOND_TABLE t1
WHERE
t0.ID (+) = t1.ID;
这是 Oracle 特定的外连接表示法。这意味着它将包括 t1 中的所有行,如果 t0 中没有相应的行,则在 t0 列中使用 NULLS。
在标准 SQL 中,可以这样写:
SELECT t0.foo, t1.bar
FROM FIRST_TABLE t0
RIGHT OUTER JOIN SECOND_TABLE t1;
甲骨文recommends not to use those joins anymore if your version supports ANSI joins (LEFT/RIGHT JOIN):
Oracle recommends that you use the FROM clause OUTER JOIN syntax rather than the Oracle join operator. Outer join queries that use the Oracle join operator (+) are subject to the following rules and restrictions […]
谁能解释一下下面代码中的 (+) 符号是什么意思。
SELECT DISTINCT ph.po_nbr, rd.id
FROM po_head a, rtable_dtl e
WHERE a.org = e.org (+)
AND a.menu_nbr = e.menu_nbr(+)
AND UPPER(a.user_id) = UPPER(e.user_id(+))
一个例子:
SELECT
t0.foo, t1.bar
FROM
FIRST_TABLE t0, SECOND_TABLE t1
WHERE
t0.ID (+) = t1.ID;
这是 Oracle 特定的外连接表示法。这意味着它将包括 t1 中的所有行,如果 t0 中没有相应的行,则在 t0 列中使用 NULLS。
在标准 SQL 中,可以这样写:
SELECT t0.foo, t1.bar
FROM FIRST_TABLE t0
RIGHT OUTER JOIN SECOND_TABLE t1;
甲骨文recommends not to use those joins anymore if your version supports ANSI joins (LEFT/RIGHT JOIN):
Oracle recommends that you use the FROM clause OUTER JOIN syntax rather than the Oracle join operator. Outer join queries that use the Oracle join operator (+) are subject to the following rules and restrictions […]