-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Andrey Fedorov
Sent: Tuesday, April 21, 2009 1:27 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Difference between all the joins

Hi all,
According to the join-op syntax [1], SQLite has 13 distinct join
statements:

,
JOIN
LEFT JOIN
OUTER JOIN
LEFT OUTER JOIN
INNER JOIN
CROSS JOIN
NATURAL JOIN
NATURAL LEFT JOIN
NATURAL OUTER JOIN
NATURAL LEFT OUTER JOIN
NATURAL INNER JOIN
NATURAL CROSS JOIN

Are they all unique? Which are equivalent?

- Andrey

1. http://sqlite.org/syntaxdiagrams.html#join-op
_______________________________________________
_______________________________________________
_______________________________________________

Hello, Andrey,

No, many are synonyms included (I think) as part of the SQL standards or
to ease conversion from various other SQL dialects.

E.g. an "unadorned" JOIN is identical to an INNER JOIN.   Inner joins
have no "left" or "right" so a LEFT JOIN can be used as a synonym for a
LEFT OUTER JOIN.  Furthermore, LEFT is a default for OUTER JOINS, so
OUTER JOIN == LEFT JOIN == LEFT OUTER JOIN.

This article looks interesting:  http://en.wikipedia.org/wiki/Join_(SQL)
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to