Re: Subqueries in select clause

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Subqueries in select clause
Дата
Msg-id 12360.987618794@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Subqueries in select clause  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-sql
"Josh Berkus" <josh@agliodbs.com> writes:
> Until you can upgrade, though, try this approach:

> CREATE VIEW c_aggregate AS
> SELECT sum(a) as sum_a, b FROM c GROUP BY b;

> SELECT max(sum_a) FROM c_aggregate;

Unfortunately that won't work in 7.0 --- grouped views have a lot of
problems in that version, and one of the problems is that you can't
do another level of aggregating on their results.

Basically a view and a subselect are the same thing, so you can't get
around the restrictions of one by using the other...

7.1 is what Sara needs.
        regards, tom lane


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

Предыдущее
От: Mathijs Brands
Дата:
Сообщение: Re: maybe Offtopic : PostgreSQL & PHP ?
Следующее
От: Stef Telford
Дата:
Сообщение: breakage in schema with foreign keys between 7.0.3 and 7.1