X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F2E75D1CA66 for ; Sat, 26 Jun 2004 01:55:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 38232-02 for ; Sat, 26 Jun 2004 04:55:52 +0000 (GMT) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by svr1.postgresql.org (Postfix) with ESMTP id 92E4FD1CA4C for ; Sat, 26 Jun 2004 01:55:47 -0300 (ADT) Received: from [212.159.87.229] (helo=thelabyrinth.force9.co.uk) by ptb-relay01.plus.net with esmtp (Exim) id 1Be5EA-000MlK-JV; Sat, 26 Jun 2004 04:55:46 +0000 Received: from ruth.localdomain (ruth.localdomain [192.168.0.1]) by thelabyrinth.force9.co.uk (Postfix) with ESMTP id 3338030060; Sat, 26 Jun 2004 04:56:37 +0100 (BST) Date: Sat, 26 Jun 2004 05:56:40 +0100 (BST) From: Sam Barnett-Cormack X-X-Sender: sdb@localhost.localdomain To: "=?iso-8859-1?q?Jhonatas=20M.=20Rodr=EDguez?=" Cc: pgsql-admin@postgresql.org Subject: Re: Continue with the original idea, about JOINS.... In-Reply-To: <20040625215623.54611.qmail@web14101.mail.yahoo.com> Message-ID: References: <20040625215623.54611.qmail@web14101.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/342 X-Sequence-Number: 14002 On Fri, 25 Jun 2004, [iso-8859-1] Jhonatas M. Rodr=EDguez wrote: > Thank you at all for yours request > > > > Hey, i have a question about of the uses the joins > in PostgreSQL. > > In SQL Server the joins i can use with the simbol(*), > Example:. the right join is > "table1.field1 =3D* table2.field2" > > In Oracle the joins are with the simbol (+), > Example:. the left join is > "table1.field1 (+)=3D table2.field2" > > What is the simbol the PostgreSQL in the use the > JOINS?.... > > I want to continue with the original idea, how i do a > join without > (table1 LEFT JOIN table2 ON (table1.field1 =3D > table2.field2) > table2 RIGHT OUTER JOIN table1 ON (table2.field2 =3D > table1.field1)) > > else with a simbol (as (*,+, anything)). The keyword you are looking for is NATURAL, provided the joining field has the same name in both tables (which is just good design practice). table1 NATURAL INNER JOIN table2, for example, is equivalent to table1 INNER JOIN table2 ON (table1.table2_keyfield =3D table2.table2_keyfield) Feel free to look in the documentation under 'joins' - it's well described in there. --=20 Sam Barnett-Cormack Student of Physics & Maths | Programmer (Perl, PHP, C++, C, whatever) Lancaster University | Administrator (PostgreSQL, Linux, whatever)