Re: A tricky sql-query...

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Mark Stosberg <mark(at)summersault(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: A tricky sql-query...
Date: 2003-11-03 01:35:13
Message-ID: 1067823313.571.95.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sun, 2003-11-02 at 19:42, Mark Stosberg wrote:
> On 2003-10-22, Timo <siroco(at)suomi24(dot)fi> wrote:
> >
> > You can't have any recursion in an pure sql-query, can you?
>
> It depends on how you think of recursion, I'd say. You join on the same
> table a number of times, by giving it a different alias each time. You
> have to manually specify (or generate with application code) all these
> aliases and joins, though. Sometimes people use this technique to
> implement tree structures in SQL.

Not to mention the WITH .. RECURSIVE clause, not yet in PostgreSQL.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Browne 2003-11-03 01:40:15 Re: A tricky sql-query...
Previous Message Mark Stosberg 2003-11-03 00:42:46 Re: A tricky sql-query...