X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A6073D1B545 for ; Mon, 27 Oct 2003 21:45:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 38720-04 for ; Mon, 27 Oct 2003 17:45:12 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id E31F7D1B529 for ; Mon, 27 Oct 2003 17:45:10 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h9RLj5Nw095602 for ; Mon, 27 Oct 2003 21:45:06 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h9RLQbRW092806 for pgsql-docs@postgresql.org; Mon, 27 Oct 2003 21:26:37 GMT Message-Id: <1503129.DJSjvup6Wb@weyoun.foo.at> From: Stefan Weiss Subject: INNER JOINS in sql-select.html X-Newsgroups: comp.databases.postgresql.docs Date: Mon, 27 Oct 2003 23:09:37 +0100 Organization: Foo Orbital Operations User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-NNTP-Posting-Host: 62.116.13.26 Lines: 31 X-Complaints-To: abuse@sil.at X-DMCA-Complaints-To: abuse@sil.at X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 To: pgsql-docs@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/39 X-Sequence-Number: 2059 Hi. From : | 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