X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7311FD1C50F for ; Wed, 23 Jul 2003 12:51:50 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 25164-04 for ; Wed, 23 Jul 2003 09:51:12 -0300 (ADT) Received: from stud.fbi.fh-darmstadt.de (stud.fbi.fh-darmstadt.de [141.100.40.65]) by svr1.postgresql.org (Postfix) with ESMTP id 9E960D1C508 for ; Wed, 23 Jul 2003 09:51:48 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by stud.fbi.fh-darmstadt.de (Postfix) with ESMTP id C1B50CE606 for ; Wed, 23 Jul 2003 14:51:49 +0200 (CEST) Received: by stud.fbi.fh-darmstadt.de (Postfix, from userid 33) id 48FE8CE606; Wed, 23 Jul 2003 14:51:48 +0200 (CEST) Received: from troubadix.lhsystems.com (troubadix.lhsystems.com [193.24.32.38]) by stud.fbi.fh-darmstadt.de (IMP) with HTTP for ; Wed, 23 Jul 2003 14:51:48 +0200 Message-ID: <1058964708.3f1e84e407a8d@stud.fbi.fh-darmstadt.de> Date: Wed, 23 Jul 2003 14:51:48 +0200 From: oheinz@stud.fbi.fh-darmstadt.de To: pgsql-sql@postgresql.org Subject: Problem using Subselect results MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 193.24.32.38 X-Scanned-By: AMaViS-ng at stud.fbi.fh-darmstadt.de. X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME, USER_AGENT_IMP X-Spam-Level: X-Archive-Number: 200307/405 X-Sequence-Number: 14519 I want to use the result of a subselect as condition of another one. CREATE VIEW my_view AS SELECT b,c (SELECT a, b FROM table2 WHERE b=1) my_ab, (SELECT c FROM table3, my_ab WHERE table3.a=my_ab.a) my_c; does return "relation my_ab unknown". it is not just a problem of execution order - if i turn it the other way round it's still the same. Am I just trying to do something really stupid? And what for is the (necessary) AS statement for subselects, if it's not possible to access their results by that name? As I need the result of a subselect in several other subselects it's not possible to transform them into a cascade of sub, subsub, subsubsub.... selects. Any ideas? TIA, Oliver ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/