Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 71274 invoked from network); 19 Sep 2007 09:21:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2007 09:21:07 -0000 Received: (qmail 21861 invoked by uid 500); 19 Sep 2007 09:20:58 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 21826 invoked by uid 500); 19 Sep 2007 09:20:58 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 21817 invoked by uid 99); 19 Sep 2007 09:20:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 02:20:58 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 09:23:01 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 984DE71418F for ; Wed, 19 Sep 2007 02:20:43 -0700 (PDT) Message-ID: <6753655.1190193643598.JavaMail.jira@brutus> Date: Wed, 19 Sep 2007 02:20:43 -0700 (PDT) From: "Thomas Nielsen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-2998) Add support for ROW_NUMBER() window function In-Reply-To: <14732006.1186647103190.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-2998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528705 ] Thomas Nielsen commented on DERBY-2998: --------------------------------------- You have a valid point Knut. Further investigation shows that the inner row_number() is executed once for every outer execution - which is the way one would like to do this. The following output from a test table with 3 rows illustrate this. Never mind the bug not distinguishing between the two row_number()s for now, but it clearly shows the order in which this is executed: ij> select row_number(),r,a,b from (select row_number() as r, t.* from t) as tr where r <=3; row_number() |R |A |B ----------------------------------------------------------------- 2 |1 |1 |9 4 |3 |2 |8 2 rows selected If the inner resultset was flagged as ordered on R the outer might use that info to determine when to stop. > Add support for ROW_NUMBER() window function > -------------------------------------------- > > Key: DERBY-2998 > URL: https://issues.apache.org/jira/browse/DERBY-2998 > Project: Derby > Issue Type: Sub-task > Components: SQL > Reporter: Thomas Nielsen > Assignee: Thomas Nielsen > Priority: Minor > Attachments: row_number_prototype-2.diff, row_number_prototype-2.stat > > > As part of implementing the overall OLAP Operations features of SQL (DERBY-581), implement the ROW_NUMBER() window function. > More information about this feature is available at http://wiki.apache.org/db-derby/OLAPRowNumber -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.