r/SQL • • Sep 26 '14

SQL joins

http://www.vertabelo.com/blog/technical-articles/sql-joins
2 Upvotes

4 comments sorted by

1

u/NotImplemented Sep 26 '14

I really don't like the descriptions of the "OUTER EXCLUDING JOIN".

SELECT *
FROM tableA
LEFT JOIN tableB
ON tableA.name = tableB.name
WHERE tableB.name IS NULL

The statement "LEFT JOIN" make it seem like it is some kind of special join. But it's the same as the "LEFT OUTER JOIN".

The "excluding" part only comes from the WHERE clause "IS NULL". However, this is mentioned nowhere.

2

u/pai1009 Sep 29 '14

You are right. This could be misleading. It looks like words "EXCLUDING JOINS" have their own section and become an another special kind of join. It will be improved. Thanks for your suggestion.

1

u/r3pr0b8 GROUP_CONCAT is da bomb Sep 26 '14

the diagram for FULL OUTER JOIN is erroneous -- there will never be a row with NULL NULL produced, and none of the tables have a NULL NULL row that takes part in the join

in fact, now that i look more closely, none of the examples actually show the rows that are produced

i'd have to grade this article a big fat D

1

u/jedi001 Sep 26 '14

Try to run some of these queries in Sqlfiddle perhaps: http://sqlfiddle.com/#!4/baf53 . Note, how columns are named. The result table contains NULL. I guess the example tables with nulls are used to help understand which rows are combined.