Return-Path: Mailing-List: contact turbine-torque-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list turbine-torque-dev@jakarta.apache.org Received: (qmail 24382 invoked by uid 98); 16 Dec 2002 15:52:45 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 24363 invoked from network); 16 Dec 2002 15:52:43 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 16 Dec 2002 15:52:43 -0000 Received: (qmail 81126 invoked by uid 500); 16 Dec 2002 15:51:32 -0000 Received: (qmail 81102 invoked from network); 16 Dec 2002 15:51:30 -0000 Received: from 12-218-147-34.client.mchsi.com (HELO localhost.localdomain) (12.218.147.34) by daedalus.apache.org with SMTP; 16 Dec 2002 15:51:30 -0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id CBC4443497 for ; Mon, 16 Dec 2002 07:51:31 -0800 (PST) Subject: Re: IN clause capable of adding a subquery? From: John McNally To: Turbine Torque Developers List In-Reply-To: <717095C7B5C4D211AD4D0008C75B84F0030D2959@172-21-14-11.ia-main.net.nob.nl> References: <717095C7B5C4D211AD4D0008C75B84F0030D2959@172-21-14-11.ia-main.net.nob.nl> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 Date: 16 Dec 2002 07:51:31 -0800 Message-Id: <1040053891.1932.96.camel@localhost.localdomain> Mime-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Sounds useful. There are ways to add such a complex criteria, but not very elegant and they pretty much boil down to constructing the string by hand. A patch would be welcome, though usage of such a construct would limit the code to use in db's that support subqueries. BTW, what is the limit in oracle for the number of items in an IN list? john mcnally On Mon, 2002-12-16 at 05:36, Remke Rutgers wrote: > Hi developers, > > As far as I can tell, it is not possible to construct an IN clause with a > subquery using Torque. > I would like to be able to construct a query of the following form: > (just a simple example) > > SELECT * FROM employees > WHERE employerid IN ( > SELECT id FROM employers > WHERE country='USA' > ) > > I can achieve the desired result in the following way: > - first create the subquery > - retrieve the result list > - use the result list in the IN criteria for the outer query. > > The number of elements in the IN clause is limited in Oracle however, so I > want to use a subquery instead of an explicit list. > > Does it seem like a good enhancement to have a subquery construct for the > IN-clause? > > Remke Rutgers > Technisch Consultant Knowledge & Learning > > Bright Alley Knowledge & Learning > Media Park - Sumatralaan 45 > Postbus 10 - 1200 JB Hilversum > Web www.brightalley.com > Telefoon direct (035) 6775668 > Fax (035) 6774355 > E-mail remke.rutgers@brightalley.nl > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: