Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 98129 invoked from network); 15 May 2008 11:27:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2008 11:27:01 -0000 Received: (qmail 3368 invoked by uid 500); 15 May 2008 11:27:01 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 3348 invoked by uid 500); 15 May 2008 11:27:01 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 3337 invoked by uid 99); 15 May 2008 11:27:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 04:27:01 -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 [67.103.199.55] (HELO dbrack01.segel.com) (67.103.199.55) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 11:26:14 +0000 Received: from Desktop02 (desktop02.segel.com [67.103.199.45]) by dbrack01.segel.com (Postfix - We shoot spammers on site.) with ESMTP id 2A7BC1E267 for ; Thu, 15 May 2008 06:33:32 -0500 (CDT) Reply-To: From: "Derby Discussion" Sender: "Michael Segel" To: "'Derby Discussion'" Subject: RE: top N reporting with derby Date: Thu, 15 May 2008 06:24:55 -0500 Organization: MSCC MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: Thread-Index: Aci2PqJ33wuR1iOXSNSBavVuGGg9VgAP1LaA Message-Id: <20080515113332.2A7BC1E267@dbrack01.segel.com> X-Virus-Checked: Checked by ClamAV on apache.org Silly question... How does Derby handle temp tables? As an example... IDS (Informix) would allow you to create temp tables on the fly, index them so you could break the query down in to simpler queries. You can't do this easily in Oracle because of how they create and maintain temporary tables. (They really aren't temporary tables.) DB2? Something similar to Oracle ... So if you can create the temp table on the fly, just store your inner query results to a temp table. HTH -Mike > -----Original Message----- > From: Six Fried Rice [mailto:technet@sixfriedrice.com] > Sent: Wednesday, May 14, 2008 10:42 PM > To: Derby Discussion > Subject: Re: top N reporting with derby > > On May 14, 2008, at 8:09 PM, Daniel Noll wrote: > > > This is quite interesting. Is there also a way to do this if you > > need to join > > to another table, such that it selects rows 100 to 200 of the first > > table > > before doing the join to the second? > > Sorry for the confusion. My post was completely bogus. That's what I > get for going from memory. Matt is completely correct: it seems you > need a sub select to get a row number in a where clause, and you can't > use order by in a sub select. Bummer really. I'm not sure *why* my > query doesn't work, but it doesn't. I should say, though, that I'm a > total derby newbie so it probably makes great sense. > > Geoff