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

2004-04-08 Thread Tom Lane
Rod Taylor <[EMAIL PROTECTED]> writes: > ROW_NUMBER() is a spec defined function. (6.10 of SQL200N) If the spec doesn't even have a year number yet, you can hardly expect real implementations to support it ;-). There is no such thing in the extant specs SQL92 or SQL99. re

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

2004-04-08 Thread Rod Taylor
On Thu, 2004-04-08 at 19:33, Greg Stark wrote: > Jeff Boes <[EMAIL PROTECTED]> writes: > > > I headed off in the direction of groups of SELECTs and UNIONs, and quit when I > > got to something like four levels of "SELECT ... AS FOO" ... > > four? wimp, that's nothing! > > ok, seriously I think t

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

2004-04-08 Thread Greg Stark
Jeff Boes <[EMAIL PROTECTED]> writes: > I headed off in the direction of groups of SELECTs and UNIONs, and quit when I > got to something like four levels of "SELECT ... AS FOO" ... four? wimp, that's nothing! ok, seriously I think there's no way to do this directly with straight SQL. You would

[SQL] SQL challenge--top 10 for each key value?

2004-04-08 Thread Jeff Boes
Offered up for anyone with time on their hands. I fiddled around with this for half an afternoon, then gave up and did it programmatically in Perl. Given a table that looks something like this: id | INTEGER query| INTEGER checksum | char(32) score| INTEGER include | BOOLEAN The t

Re: [SQL] Encoding and result string length

2004-04-08 Thread Richard Huxton
On Thursday 08 April 2004 10:32, kumar wrote: > > create table encodeco(c1 int4, c2 int4); > insert into encodeco values(1, 2); > select * from encodeco; > > So I want to encode the data while selecting. > select encode(c1,'base64') from encodeco; > So i tried > select encode('c1','ba

[SQL] Encoding and result string length

2004-04-08 Thread kumar
Dear Friends,   Postgres 7.3.2 on Linux 8   I would like to fetch the datas from a table in a encoded format.   create table encodeco(c1 int4, c2 int4);insert into encodeco values(1, 2);select * from encodeco;   So I want to encode the data while selecting. select encode(c1,'base64')