X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7A5ECD1B4F2 for ; Mon, 3 Nov 2003 01:35:57 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 53418-06 for ; Sun, 2 Nov 2003 21:35:29 -0400 (AST) Received: from mail.hive.nj2.inquent.com (mc.carriermail.com [205.178.180.9]) by svr1.postgresql.org (Postfix) with SMTP id EFC8AD1C515 for ; Sun, 2 Nov 2003 21:35:24 -0400 (AST) Received: (qmail 340 invoked from network); 3 Nov 2003 01:35:22 -0000 Received: from unknown (HELO ?192.168.1.199?) (134.22.69.96) by 205.178.180.9 with SMTP; 3 Nov 2003 01:35:22 -0000 Subject: Re: A tricky sql-query... From: Rod Taylor To: Mark Stosberg Cc: pgsql-sql@postgresql.org In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Uf4KYW6jnoQ0/QTBUfMZ" Message-Id: <1067823313.571.95.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sun, 02 Nov 2003 20:35:13 -0500 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/8 X-Sequence-Number: 15823 --=-Uf4KYW6jnoQ0/QTBUfMZ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2003-11-02 at 19:42, Mark Stosberg wrote: > On 2003-10-22, Timo wrote: > > > > You can't have any recursion in an pure sql-query, can you? >=20 > 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=20 > have to manually specify (or generate with application code) all these=20 > aliases and joins, though. Sometimes people use this technique to > implement tree structures in SQL.=20=20 Not to mention the WITH .. RECURSIVE clause, not yet in PostgreSQL. --=-Uf4KYW6jnoQ0/QTBUfMZ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/pbDQ6DETLow6vwwRArdSAJ9UZTAUnn0zIC+s5AZSkeXwOiMV5wCeKiO+ nQL10fu0x2IqBK+NmeXKnzE= =wuwC -----END PGP SIGNATURE----- --=-Uf4KYW6jnoQ0/QTBUfMZ--