X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 96059D1D065 for ; Fri, 9 Apr 2004 13:07:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 45152-07 for ; Fri, 9 Apr 2004 13:07:06 -0300 (ADT) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id BB9A3D1D064 for ; Fri, 9 Apr 2004 13:07:05 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 4806216; Fri, 09 Apr 2004 09:08:27 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Rod Taylor , Greg Stark Subject: Re: SQL challenge--top 10 for each key value? Date: Fri, 9 Apr 2004 09:06:39 -0700 User-Agent: KMail/1.4.3 Cc: Jeff Boes , pgsql-sql@postgresql.org References: <33af4fa4e4ec230574cefcff737ea40a@news.teranews.com> <87r7uyf3ki.fsf@stark.xeocode.com> <1081481466.56361.808.camel@jester> In-Reply-To: <1081481466.56361.808.camel@jester> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200404090906.39541.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/73 X-Sequence-Number: 17448 Rod, > Something along the lines of the below would accomplish what you want > according to spec. ROW_NUMBER() is a spec defined function. (6.10 of > SQL200N) Great leaping little gods! They added something called "row number" to the spec? Boy howdy, folks were right ... the ANSI committee really has completly blown off the relational model completely. First there was the addition of network-database functions so that IBM could make DB2 look more like a real database, now this .... When a standards committee becomes hostage to a handful of vendors, kiss real standards goodbye. -- Josh Berkus Aglio Database Solutions San Francisco