在Oracle中,(+)表示JOIN中的“可選”表。 所以在你的查詢中,
select a.id, b.id, a.col_2, b.col_2, ... from a,b where a.id=b.id(+)
這是一個左'外'加'B'表與'一個表。 就像現代的左連接查詢一樣。 (它將返回'a'表的所有數據,而不會丟失在另一邊的數據可選表'b'可以丟失他的數據)
select a.id, b.id, a.col_2, b.col_2, ... from a Left join b ON a.id=b.id
要么
select a.id, b.id, a.col_2, b.col_2, ... from a Left join b using(id)
現在如果你刪除(+),那么這將是正常的內部連接查詢,
select a.id, b.id, a.col_2, b.col_2, ... from a,b where a.id=b.id
它只會返回所有'a'和'b'表'id'值相同的數據,意味著通用部分。
額外:如果你想讓你的查詢作為正確的join舊的格式或現代,那么它將顯示為如下所示:
舊:
select a.id, b.id, a.col_2, b.col_2, ... from a,b where a.id(+)=b.id
現代:
select a.id, b.id, a.col_2, b.col_2, ... from a Right join b ON a.id=b.id
要么
select a.id, b.id, a.col_2, b.col_2, ... from a Right join b using(id)
參考和幫助:
左外部在Oracle 11g中使用+符號join