Re: Recursive queries? - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Recursive queries?
Date
Msg-id 1075912946.3122.40.camel@fuji.krosing.net
Whole thread Raw
In response to Re: Recursive queries?  (Christopher Browne <cbbrowne@acm.org>)
List pgsql-hackers
Christopher Browne kirjutas K, 04.02.2004 kell 15:10:

> The fact that the form of this resembles that of the Lisp/ML "let"
> forms means that WITH can be useful in structuring queries as well.
> For instance, supposing you're computing a value that gets used
> several times, putting it into a WITH clause might allow evading the
> need to compute it more than once.

The main difference between giving the subquery in WITH and in FROM, is
that the subqueries given in FROM claues don't see each other, while the
ones given in WITH see the ones preceeding them and the ones in WITH
RECURSIVE see all queries in the WITH RECURSIVE clause.

--------------
Hannu



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Recursive queries?
Next
From: strk
Date:
Subject: Re: PostGIS Integration