Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 58509 invoked from network); 18 Oct 2007 11:40:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Oct 2007 11:40:18 -0000 Received: (qmail 74206 invoked by uid 500); 18 Oct 2007 11:40:05 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 74195 invoked by uid 500); 18 Oct 2007 11:40:05 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 74184 invoked by uid 99); 18 Oct 2007 11:40:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 04:40:04 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [217.24.207.26] (HELO mail.seitenbau.net) (217.24.207.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 11:40:08 +0000 Received: from [192.168.15.18] (helo=www.seitenbau.net) by router.seitenbau.net with esmtp (Exim 4.43) id 1IiTj5-00004q-N2 for torque-user@db.apache.org; Thu, 18 Oct 2007 13:39:46 +0200 In-Reply-To: <000d01c81176$a7e1b7e0$f7a527a0$@com> Subject: RE: Left Join on multiple clauses To: "Apache Torque Users List" X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Thomas Fischer Date: Thu, 18 Oct 2007 13:39:42 +0200 X-MIMETrack: Serialize by Router on www/seitenbau(Release 7.0.1|January 17, 2006) at 18.10.2007 01:39:43 PM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Spam-Score: -1.4 (-) X-Spam-Report: -1.4 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Virus-Checked: Checked by ClamAV on apache.org Torque can only create joins using one join statement per join; and the join operator must be the "equals" operator. If you need something else, you would have to assemble at least parts of the sql statement manually. Having said that, I'm not sure whether the statement in your last mail is correct, but I have not tested it. Make sure you have tested it. As a last resort, you can always use two selects, one which gets the records which do have an associated record in the joined table and one which gets the others. Thomas "Jonathan Halland" schrieb am 18.10.2007 13:04:21: > If I move the CAMPAIGN_ID=16 to the where clause I will essentially have the > same as a inner join, I however need to access the records that do not > necessarily have a matching record in the right side table. > > Regards > JOnathan > > -----Original Message----- > From: Manaster, Carl [mailto:CarlM@ACTIVX.com] > Sent: 17 October 2007 06:09 PM > To: Apache Torque Users List > Subject: RE: Left Join on multiple clauses > > Hi, Jonathan, > > As I see it, "joining" to a constant doesn't really make sense, although > it might work in some or all cases, might even be perfectly valid > syntactically. I would move the CAMPAIGN_ID=16 test to the WHERE > clause. > > Peace, > --Carl > > -----Original Message----- > From: Jonathan Halland [mailto:jonathan@spiraleye.com] > Sent: Wednesday, October 17, 2007 9:04 AM > To: torque-user@db.apache.org > Subject: Left Join on multiple clauses > > > > > Hi, > > > > I'm new to this list, but I've been struggling for quite a while > to get the following right. > > > > I need to do a left join on two clauses e.g. > > > > LEFT JOIN campaign_handled_objects on > accounts.ACCOUNT_ID=campaign_handled_objects.OBJECT_ID AND > campaign_handled_objects.CAMPAIGN_ID=16 > > > > So far no such luck. > > > > Any Help would be immensely appreciated > > > > Regards > > Jonathan > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org