public inbox for [email protected]  
help / color / mirror / Atom feed
From: Stefan Weiss <[email protected]>
To: [email protected]
Subject: INNER JOINS in sql-select.html
Date: Mon, 27 Oct 2003 23:09:37 +0100
Message-ID: <[email protected]> (raw)

Hi.

From <doc/html/sql-select.html>:
| A CROSS JOIN or INNER JOIN is a simple Cartesian product, the same
| as you get from listing the two items at the top level of FROM. CROSS
| JOIN is equivalent to INNER JOIN ON (TRUE), that is, no rows are
| removed by qualification. These join types are just a notational
| convenience, since they do nothing you couldn't do with plain FROM 
| and WHERE.

Is there really no difference between these two queries?

SELECT blarg
  FROM ta, tb, tc, [...]
 WHERE ta.foo = tb.bar
   AND tb.bar = tc.baz
   AND [...]

SELECT blarg
  FROM ta
  JOIN tb ON tb.bar = ta.foo
  JOIN tc ON tc.baz = tb.bar
  JOIN [...]

I thought that by using the second form, you would be able to do
'explicit' joins, effectivly telling the planner in which order to
join multiple tables (in case you have to join 10+ tables)?


cheers,
stefan



view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: INNER JOINS in sql-select.html
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox