X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A8713475BC3 for ; Wed, 19 Feb 2003 23:06:46 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 37559-10 for ; Wed, 19 Feb 2003 23:06:35 -0500 (EST) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 57923475C22 for ; Wed, 19 Feb 2003 23:02:20 -0500 (EST) Received: (qmail 12971 invoked from network); 20 Feb 2003 04:00:10 -0000 Received: from ns1.trade-india.com (HELO www.trade-india.com) (66.234.10.14) by infocom-236-129-del.trade-india.com with SMTP; 20 Feb 2003 04:00:10 -0000 Received: (qmail 19505 invoked by uid 99); 20 Feb 2003 04:02:25 -0000 Received: from 219.65.252.17 (SquirrelMail authenticated user mallah) by mail.trade-india.com with HTTP; Thu, 20 Feb 2003 09:32:25 +0530 (IST) Message-ID: <1130.219.65.252.17.1045713745.squirrel@mail.trade-india.com> Date: Thu, 20 Feb 2003 09:32:25 +0530 (IST) Subject: Re: simple join problem From: To: In-Reply-To: <004001c2d85c$05d214c0$6900a8c0@mattspc> References: <200302191249.26342.josh@agliodbs.com> <004001c2d85c$05d214c0$6900a8c0@mattspc> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: , X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/444 X-Sequence-Number: 11842 Good to see that you got the answer to ur problem. But i have a question to u. Why at all are you keeping 4 tables and joining them too. why not have a single table with all the merged columns? In my place i too have a database stuructue similar to you but lately i realized the other option would have been better. becoz for every datamining query i am having to join multiple table which is not very favou= rable to performance. i know it may not be the proper forum to discuss this. regds mallah. >> > >> > Here's my view definition: >> > SELECT >> > users.uid, users.loginid, users."password", users.title, >> > users.firstname, users.middlename, users.lastname, users.suffix, user= s.organization, >> > users.job_title, users_address.address1, >> > users_address.address2, users_address.address3, users_address.city, >> > users_address.state, users_address.zip, users_address.country, >> > users_email.email, users_phone.phone >> > FROM (((users >> > LEFT JOIN users_address ON ((users.uid =3D users_address.uid AND >> users_address.primary =3D TRUE))) >> > LEFT JOIN users_email ON ((users.uid =3D users_email.uid and >> users_email.primary =3D TRUE))) >> > LEFT JOIN users_phone ON ((users.uid =3D users_phone.uid and >> users_phone.primary =3D TRUE))) ; >> >> It's a neat trick that join conditions can be *any* expression that eval= uates >> to a boolean value. > > That is a neat trick. Thanks for the info everyone. I feel better knowi= ng that even though it > was a simple problem it's not quite as obvious as I thought. > > -- > Matthew Nuzum > www.bearfruit.org > cobalt@bearfruit.org > > > > ---------------------------(end of broadcast)--------------------------- = TIP 4: Don't 'kill -9' > the postmaster ----------------------------------------- Get your free web based email at trade-india.com. "India's Leading B2B eMarketplace.!" http://www.trade-india.com/