Re: Question About Aggregate Functions

Поиск
Список
Период
Сортировка
От Oscar Rodriguez Fonseca
Тема Re: Question About Aggregate Functions
Дата
Msg-id 1158146512.6056.52.camel@vrlap.localvrnet
обсуждение исходный текст
Ответ на Question About Aggregate Functions  ("Don Parris" <parrisdc@gmail.com>)
Список pgsql-novice
El mié, 13-09-2006 a las 13:16 +0200, Oscar Rodriguez Fonseca escribió:

> A query (UNTESTED) that should solve your problem may be this one:
>
> SELECT     a.count AS "t1fielda",
>     b.count AS "t2fielda",
>     c.count AS "t2fieldb",
>     d.avg AS "t2avgc"
> FROM    (SELECT count(*) FROM t1 WHERE fielda = TRUE) AS a
> JOIN    (SELECT count(*) FROM t2 WHERE fielda = TRUE) AS b ON TRUE
> JOIN    (SELECT count(*) FROM t2 WHERE fieldb = TRUE) AS c ON TRUE
> JOIN     (SELECT avg(fieldc) FROM t2) AS d ON TRUE;
>
> I am also a DB novice so this is correct.

Sorry, I was trying to write:

"I am also a DB novice so I HOPE this is correct".

Best regards.



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

Предыдущее
От: Q Beukes
Дата:
Сообщение: pg_dump password
Следующее
От: Oscar Rodriguez Fonseca
Дата:
Сообщение: Re: Question About Aggregate Functions