Search Postgresql Archives

Re: WITH and WITH RECURSIVE in single query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 4, 2011, at 22:28, Maxim Boguk <maxim.boguk@xxxxxxxxx> 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.
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux