Re: LIMIT and SUBQUERIES

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org, cprice(at)hrdenterprises(dot)com
Subject: Re: LIMIT and SUBQUERIES
Date: 2003-03-05 15:22:46
Message-ID: 87fzq196t5.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Christoph Haller <ch(at)rodos(dot)fzk(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Chad Thompson 2003-03-05 15:52:46 Re: DELETE FROM A BLACK LIST
Previous Message Achilleus Mantzios 2003-03-05 15:21:34 Re: DELETE FROM A BLACK LIST