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 F41CC52A07 for ; Fri, 22 Jul 2005 09:13:20 -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 64218-06 for ; Fri, 22 Jul 2005 12:13:16 +0000 (GMT) Received: from kiwi.adonten.net (kiwi.adonten.net [204.157.14.138]) by svr1.postgresql.org (Postfix) with ESMTP id 1257152A01 for ; Fri, 22 Jul 2005 09:13:15 -0300 (ADT) Received: (qmail 24257 invoked from network); 22 Jul 2005 12:13:18 -0000 Received: from localhost (127.0.0.1) by localhost with SMTP; 22 Jul 2005 12:13:18 -0000 Received: from 82-70-183-14.dsl.in-addr.zen.co.uk (82-70-183-14.dsl.in-addr.zen.co.uk [82.70.183.14]) by webmail.adontendev.net (IMP) with HTTP for ; Fri, 22 Jul 2005 12:13:17 +0000 Message-ID: <1122034397.42e0e2ddc3f4a@webmail.adontendev.net> Date: Fri, 22 Jul 2005 12:13:17 +0000 From: frank church To: pgsql-sql@postgresql.org Subject: Using subselects as joins in POstgeSQL (possible?, examples) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.3 X-Originating-IP: 82.70.183.14 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.253 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/187 X-Sequence-Number: 22165 Is it possible to use subselects as joins in PostgreSQL. eg. select a.a, a.b, a.c, b.a, b.b. b.c from (first subsselect) a (second subselect) b where (in table criteria) and a.a = b.a or select a.a, a.b, a.c, b.a, b.b. b.c from (first subsselect) a join (second subselect) b on a.a = b.a where (in table criteria) I have a feeling it is possible but I need the right syntax //Frank ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.