pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Cc: cprice@hrdenterprises.com
Subject: Re: LIMIT and SUBQUERIES
Date: 05 Mar 2003 10:22:46 -0500
Message-ID: <87fzq196t5.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <3E65FA8B.352136E@rodos.fzk.de>
References: <3E65FA8B.352136E@rodos.fzk.de>

Christoph Haller <ch@rodos.fzk.de> writes:

> >
> > So anyway, I have the query that is working - but it returns all
> > records for all owners, when what I really want to do is return the
> > top 5 per each owner.
> >
> I've seen a lot of questions like this on the list before about
> filtering
> result sets. Within the most replies, people were told to use middleware
> 
> stuff like perl, awk, sed, ... to filter out unwanted rows, because SQL
> was not intended to do so.

This is the same problem as the "ranking" problem that I mentioned earlier.

http://archives.postgresql.org/pgsql-sql/2003-03/msg00013.php

Essentially we would need a kind of feature that has some similarities to user
defined aggregates but is not exactly the same thing. The feature doesn't
currently exist, and I haven't seen it in order databases, so I don't even
know exactly what it would look like.

-- 
greg




view thread (4+ messages)

Message-ID: <87fzq196t5.fsf@stark.dyndns.tv>
Permalink:  ../87fzq196t5.fsf@stark.dyndns.tv/
Also on:    postgresql.org/message-id/87fzq196t5.fsf@stark.dyndns.tv

 · 

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, ch@rodos.fzk.de, cprice@hrdenterprises.com
  Subject: Re: LIMIT and SUBQUERIES
  In-Reply-To: <87fzq196t5.fsf@stark.dyndns.tv>

* 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