Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 37BB61337B93 for ; Wed, 20 Apr 2011 13:09:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 87044-02 for ; Wed, 20 Apr 2011 16:09:12 +0000 (UTC) X-Greylist: delayed 00:07:14.832371 by SQLgrey-1.7.6 Received: from exprod7og122.obsmtp.com (exprod7og122.obsmtp.com [64.18.2.22]) by mail.postgresql.org (Postfix) with ESMTP id 591671337B47 for ; Wed, 20 Apr 2011 13:09:12 -0300 (ADT) Received: from mail-pw0-f50.google.com ([209.85.160.50]) (using TLSv1) by exprod7ob122.postini.com ([64.18.6.12]) with SMTP ID DSNKTa8FJ63cAdpxFuRU0St5FR4zW2Iw1ibr@postini.com; Wed, 20 Apr 2011 09:09:12 PDT Received: by pwi3 with SMTP id 3so660408pwi.37 for ; Wed, 20 Apr 2011 09:09:11 -0700 (PDT) Received: by 10.68.2.196 with SMTP id 4mr6141003pbw.314.1303315316123; Wed, 20 Apr 2011 09:01:56 -0700 (PDT) Received: from [172.24.35.132] ([59.162.78.200]) by mx.google.com with ESMTPS id d3sm703725pbh.73.2011.04.20.09.01.53 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2011 09:01:55 -0700 (PDT) Subject: Re: How to realize ROW_NUMBER() in 8.3? Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Vibhor Kumar In-Reply-To: <4DAEFF97.9020608@encs.concordia.ca> Date: Wed, 20 Apr 2011 21:36:49 +0530 Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <736186FB-A7FD-4E7B-85C2-576D81D9ED75@enterprisedb.com> References: <4DAEFF97.9020608@encs.concordia.ca> To: emilu@encs.concordia.ca X-Mailer: Apple Mail (2.1084) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/29 X-Sequence-Number: 35276 On Apr 20, 2011, at 9:15 PM, Emi Lu wrote: > ROW_NUMBER() is only ready in 8.4. For 8.3, is there a simple way to = get row_number > select row_number(), col1, col2... > FROM tableName Following is a link of deepsz which has a way of implementation of = rownum. = http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in= -one-query/ Thanks & Regards, Vibhor Kumar EnterpriseDB Corporation The Enterprise PostgreSQL Company vibhor.kumar@enterprisedb.com Blog:http://vibhork.blogspot.com