Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 16831 invoked from network); 1 Aug 2007 10:54:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2007 10:54:35 -0000 Received: (qmail 94669 invoked by uid 500); 1 Aug 2007 10:54:34 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 94654 invoked by uid 500); 1 Aug 2007 10:54:34 -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 94640 invoked by uid 99); 1 Aug 2007 10:54:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.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; Wed, 01 Aug 2007 03:54:33 -0700 Received: from [192.168.15.18] (helo=www.seitenbau.net) by router.seitenbau.net with esmtp (Exim 4.43) id 1IGBnC-0004kw-Ln for torque-user@db.apache.org; Wed, 01 Aug 2007 12:51:03 +0200 In-Reply-To: Subject: RE: subqueries in criteria To: "Apache Torque Users List" X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Thomas Fischer Date: Wed, 1 Aug 2007 12:51:01 +0200 X-MIMETrack: Serialize by Router on www/seitenbau(Release 7.0.1|January 17, 2006) at 01.08.2007 12:51:02 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 Hi, here is an example from one of the test classes for creating a subquery: Criteria subquery = new Criteria(); subquery.addSelectColumn(AuthorPeer.AUTHOR_ID); subquery.add(AuthorPeer.NAME, author2.getName()); Criteria criteria = new Criteria(); criteria.add(AuthorPeer.AUTHOR_ID, subquery, Criteria.IN); List result = AuthorPeer.doSelect(criteria); Hope this helps, Thomas "Neelima Yadla" schrieb am 27.07.2007 16:31:43: > Hi, > > > > How to write criteria for the following sql, > > > > select count (*) from (select first, max (second), third > > from testtable > > group by first, third > > > > Thanks, > > Neelima > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org