Re: need some help on figuring out how to write a query

Поиск
Список
Период
Сортировка
От Dean Gibson (DB Administrator)
Тема Re: need some help on figuring out how to write a query
Дата
Msg-id 47BE2EE6.1020502@ultimeth.com
обсуждение исходный текст
Ответ на need some help on figuring out how to write a query  (Justin <justin@emproshunts.com>)
Ответы Re: need some help on figuring out how to write a query
Список pgsql-general
On 2008-02-21 13:37, Justin wrote:
> ...  I'm wondering if there is a way to create this in a single select
> statement??
> I can't think of a way to do it???
Break down your problem using VIEWs.  Create a VIEW that gets just ONE
of the averages, based on a starting date.  Then create a SELECT that
gets data from the VIEW as though it was an actual table.

Once you get it working, you can replace the reference to the VIEWs in
the SELECT statement, with the definition of the VIEWs, but I would not
do that unless the result is relatively simple and easy to understand.
Maintainability should be your goal.

-- Dean

--
Mail to my list address MUST be sent via the mailing list.
All other mail to my list address will bounce.


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

Предыдущее
От: brian
Дата:
Сообщение: Re: New inst. 8.3.0 has no client
Следующее
От: "Alex Turner"
Дата:
Сообщение: Re: Postgres 8.3 broke everything