Re: Recursive queries?

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Christopher Browne <cbbrowne(at)acm(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Recursive queries?
Date: 2004-02-04 16:42:26
Message-ID: 1075912946.3122.40.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message strk 2004-02-04 17:35:11 Re: PostGIS Integration
Previous Message Hannu Krosing 2004-02-04 16:36:38 Re: Recursive queries?