Re: LIMIT and SUBQUERIES

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: LIMIT and SUBQUERIES
Дата
Msg-id 87fzq196t5.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на Re: LIMIT and SUBQUERIES  (Christoph Haller <ch@rodos.fzk.de>)
Список pgsql-sql
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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Achilleus Mantzios
Дата:
Сообщение: Re: sort / limit / range problem
Следующее
От: patrick
Дата:
Сообщение: upgrading from 7.1.2 to 7.3.2