Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f0ODS5000477 for ; Wed, 24 Jan 2001 08:28:05 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0N3xV003437 for ; Mon, 22 Jan 2001 22:59:31 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f0N3Ul345793 for pgsql-sql@postgresql.org; Mon, 22 Jan 2001 22:30:47 -0500 (EST) (envelope-from news) From: "PM" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Joining several tables Date: Mon, 22 Jan 2001 19:35:50 -0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 30 Message-ID: <94itt6$1cmu$1@news.tht.net> References: <4.3.1.0.20010122001803.00a99dd0@198.78.130.6> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: pgsql-sql@postgresql.org X-Archive-Number: 200101/323 X-Sequence-Number: 995 As long as the contactid is not null in any of the tables its easy. You didn't give any column name information so I'll wing it. Not knowing the relationships between the tables means this might get you a fair amount of repeat data. If there is only ONE row in each table for a given contactid it'll work ok. SELECT street,phone,contname FROM Address a, PhoneNumber p, Contact c WHERE a.contactid=p.contactid and a.contactid=c.contactid; I have no affiliation with cold remedy manufacturers (heh, Contact c...) "Stephan Richter" wrote in message news:4.3.1.0.20010122001803.00a99dd0@198.78.130.6... > Hello, I have the following situation: > > I have an Address, PhoneNumber and Contact table all having a contactid in > common, but sometimes the phone number does not exist. > > I want to join these three tables. How do I do that? I could not find the > syntax for multiple tables... > > Regards, > Stephan > -- > Stephan Richter > CBU - Physics and Chemistry Student > Web2k - Web Design/Development & Technical Project Management >