Re: SQL challenge--top 10 for each key value?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Rod Taylor <pg(at)rbt(dot)ca>, Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL challenge--top 10 for each key value?
Date: 2004-04-10 15:51:14
Message-ID: 200404100851.14683.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Rod, Greg

> It's not really like Oracles row num at all, though I suppose you can
> emulate rownum using it. The intention is that you will use it for
> "aggregates" like running totals, moving averages, counting, etc.

Yes, that makes a certain amount of sense. I just take exception to the name
"Row Number" becuase it confuses newbies about the actual nature of the data
being returned and gets them back in the bad space of believing in fixed data
ordering -- something which RDBMSes are supposed to avoid.

I'm also disgusted at the vendor partiality that this shows. PostgreSQL and
MySQL both have working implementations of a very similar concept using the
non-confusing term "Limit". However, since Oracle is on the committee, they
had to use a more "Oracle-friendly" term, I guess.

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

Well, there *was* a pretense otherwise, which ended about 1994, just as we
were getting SQL on this project. Now the big vendors -- mostly IBM and
Oracle since Informix and Sybase are dying -- run everything and adapt the
standard to what features their products already have.

So, yes, SQL92 needed development and expansion. But we didn't need SQL99.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kemin Zhou 2004-04-10 21:32:46 begin update ... syntax error
Previous Message Josh Berkus 2004-04-10 15:19:19 Re: setting a non-standard date format for the duration of a session