pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Josh Berkus <josh@agliodbs.com>
Cc: Rod Taylor <pg@rbt.ca>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Jeff Boes <jboes@nexcerpt.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL challenge--top 10 for each key value?
Date: 09 Apr 2004 18:43:25 -0400
Message-ID: <87ad1kg4c2.fsf@stark.xeocode.com> (raw)
In-Reply-To: <200404090906.39541.josh@agliodbs.com>
References: <33af4fa4e4ec230574cefcff737ea40a@news.teranews.com>
	<87r7uyf3ki.fsf@stark.xeocode.com>
	<1081481466.56361.808.camel@jester>
	<200404090906.39541.josh@agliodbs.com>

Josh Berkus <josh@agliodbs.com> writes:

> 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.   

If it's like Oracle's rownum then it's the row number of the *output*, not the
position on disk. So it's not entirely blowing off the relational model any
more than ORDER BY does.

The weird thing is the number of cases where you want ORDER BY or rownum
inside subselects. Which the solution to the original question needed.

> When a standards committee becomes hostage to a handful of vendors, kiss
> real standards goodbye.

In the case of SQL was there ever any pretension otherwise? Was the SQL
standard ever really useful as a "real standard"? I can write useful ANSI C89
code that will compile and work on any C compiler. Trying to write portable
SQL92 code that does any useful work is about as productive as stapling bagels
to your forehead.

-- 
greg




view thread (16+ messages)  latest in thread

Message-ID: <87ad1kg4c2.fsf@stark.xeocode.com>
Permalink:  ../87ad1kg4c2.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87ad1kg4c2.fsf@stark.xeocode.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gsstark@mit.edu, josh@agliodbs.com, pg@rbt.ca, jboes@nexcerpt.com
  Subject: Re: SQL challenge--top 10 for each key value?
  In-Reply-To: <87ad1kg4c2.fsf@stark.xeocode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox