Friday, October 1, 2010

The Beauty of JOIN(T)S

I don't think that the majority of Java Developers know that
( see http://en.wikipedia.org/wiki/Join_%28SQL%29 )
in nature there is an incredible number of JOINs :

INNER JOIN
IMPLICIT JOIN
EQUI JOIN
NATURAL JOIN
CROSS JOIN
LEFT OUTER JOIN
RIGHT OUTER JOIN
FULL OUTER JOIN
SELF JOIN

Of course if you think of a JOIN in terms of SEX, there are a lot of Kamasutra positions here to try (I am curious about the EQUI: does it refer to a horse? Jeez! Anyway I am an expert in SELF JOIN).


Most likely you will never use ALL of them, but when you struggle with a wrong result set it's good to know that you have many options to try - and then give up and start using a ORM tool.

And here is a NORMAL JOIN

and instructions on how to use it: http://www.seedsfromamsterdam.com/joint.html
(long live Amsterdam, one of the most beautiful cities on Mother Earth)

No comments: