X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4B2B39FA42B for ; Mon, 26 Jun 2006 10:39:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 69274-03 for ; Mon, 26 Jun 2006 10:39:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 4866A9F9FE3 for ; Mon, 26 Jun 2006 10:39:18 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 5B58630926; Mon, 26 Jun 2006 15:39:16 +0200 (MET DST) From: "filippo" X-Newsgroups: pgsql.sql Subject: join two tables with sharing some columns between two Date: 26 Jun 2006 06:39:11 -0700 Organization: http://groups.google.com Lines: 35 Message-ID: <1151329151.231866.175920@u72g2000cwu.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 lps1.agr.st.com:8080 (Squid/2.4.STABLE7), 1.0 eta.dmz-it.st.com:8080 (Squid/2.4.STABLE7) Complaints-To: groups-abuse@google.com Injection-Info: u72g2000cwu.googlegroups.com; posting-host=57.78.11.38; posting-account=MMcEjg0AAAA--8UL7aBU2jn4y8fFaVqr To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/15 X-Sequence-Number: 25589 Hi, I have two tables like these: (this is an example, the actual tables have diffferent fields and meanings) TABLE1 id person_name date_arrival date_departure TABLE2 id car_description date_arrival date_departure I'd like to make a query to have such resulting table RESULTING_TABLE id person_name car_description date_arrival date_departure the id is the primary key for the three tables and it's unique for the three (id in table1 cannot be in table2, I use the same counter to generate the id for table1 and table2). I is possible to create such a query? Thanks