X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E487352812 for ; Mon, 6 Jun 2005 15:08:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60518-08 for ; Mon, 6 Jun 2005 18:08:16 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id B865A528A9 for ; Mon, 6 Jun 2005 15:08:14 -0300 (ADT) Received: (qmail-ldap/ctrl 2173 invoked from network); 6 Jun 2005 18:08:11 -0000 Received: from unknown (HELO io.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 6 Jun 2005 18:08:11 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by io.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j56I8DG13599; Mon, 6 Jun 2005 20:08:13 +0200 (MEST) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Mon, 6 Jun 2005 20:08:13 +0200 Message-ID: From: =?UTF-8?B?S8OWUEZFUkwgUm9iZXJ0?= To: "'Markus Bertheau ?'" , pgsql-sql@postgresql.org Subject: Re: SQL equivalent to nested loop Date: Mon, 6 Jun 2005 20:08:07 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/88 X-Sequence-Number: 21689 This is basicly a Join, a cross table i.e. select b.w from table a, table b where ... |-----Original Message----- |From: twanger@bluetwanger.de [mailto:twanger@bluetwanger.de] |Sent: Montag, 06. Juni 2005 18:53 |To: pgsql-sql@postgresql.org |Subject: [SQL] SQL equivalent to nested loop | | |Hi, | |I basically need the SQL equivalent of the following pseudo code: | |BEGIN |FOR v IN SELECT * FROM f(4, 'foo') LOOP | FOR w IN SELECT * FROM f(v.id, 'bar') LOOP | RETURN NEXT W | END LOOP; |END LOOP; |RETURN; | |Is that possible in SQL? | |Markus | |--=20 |Markus Bertheau =E2=98=AD | | |---------------------------(end of=20 |broadcast)--------------------------- |TIP 7: don't forget to increase your free space map settings |