The syntax for the SQL FULL OUTER JOIN is: SELECT columns FROM table1 FULL [OUTER] JOIN table2 ON table1. column = table2.
The plus sign is Oracle syntax for an outer join. There isn't a minus operator for joins. An outer join means return all rows from one table. Also return the rows from the outer joined where there's a match on the join key.
The (+) operator indicates an outer join. This means that Oracle will still return records from the other side of the join even when there is no match.
There are four main types of JOINs in SQL: INNER JOIN, OUTER JOIN, CROSS JOIN, and SELF JOIN.
I have noticed a few times when working on legacy code, that you can do left and right outer joins in sql by using the
=*
as kind of shorthand for "right outer join" and
*=
as kind of shorthand for "left outer join" in statements like this:
select table1.firstname, table2.lastname
from table1, table2
where table1.id *= table2.id
I would guess that there are other operators like these two for the different kinds of joins, but i have not been able to find any good complete documentation about it. So do you know any good links to documentation?
I personaly think that the SQL statements i have seen using these operators are more difficult to figure out than when using the spelled out syntax, so is there any benefits using the shorthand version?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With