Re: WITH and WITH RECURSIVE in single query

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: WITH and WITH RECURSIVE in single query
Дата
Msg-id 8F745C3E-E709-4491-902C-DF9A84958B5B@yahoo.com
обсуждение исходный текст
Ответ на WITH and WITH RECURSIVE in single query  (Maxim Boguk <maxim.boguk@gmail.com>)
Ответы Re: WITH and WITH RECURSIVE in single query
Список pgsql-general
On Dec 4, 2011, at 22:28, Maxim Boguk <maxim.boguk@gmail.com> wrote:

> Hi.
>
> Is here any way to combine WITH and WITH RECURSIVE into single query?
>
> Something like:
>
> WITH t AS (some complicated select to speed up recursive part),
> RECURSIVE r AS
> (
> ...
> UNION ALL
> ...
> )
>
> ?
>
> --
> Maxim Boguk
> Senior Postgresql DBA.

WITH RECURSIVE q1 As (), q2 AS () ...

Add RECURSIVE after the WITH; it then applies to any/all the CTEs.

Look at the specification (and description) in the SELECT documentation closely.

David J.

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

Предыдущее
От: Maxim Boguk
Дата:
Сообщение: Questions about setting an array element value outside of the update
Следующее
От: Maxim Boguk
Дата:
Сообщение: Re: WITH and WITH RECURSIVE in single query