X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A0DD09FB30E for ; Tue, 22 Aug 2006 22:48:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 32284-01 for ; Tue, 22 Aug 2006 22:47:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from talk.nabble.com (www.nabble.com [72.21.53.35]) by postgresql.org (Postfix) with ESMTP id EEF379FB2B6 for ; Tue, 22 Aug 2006 22:47:52 -0300 (ADT) Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GFhqR-0004QK-BN for pgsql-sql@postgresql.org; Tue, 22 Aug 2006 18:47:51 -0700 Message-ID: <5936948.post@talk.nabble.com> Date: Tue, 22 Aug 2006 18:47:51 -0700 (PDT) From: chrisj To: pgsql-sql@postgresql.org Subject: error with mor than 1 sub-select MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.96 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/158 X-Sequence-Number: 26116 Hi, I am fairly new to PostgreSQL but not to SQL. Is this a bug or a limitation... The first query works fine, but when a second sub-query is added I get a syntax error... psql protocal2 -U p2user << EOF1 select * from serv_res SR where serv_key = 10 and not exists (select 1 from reservation R ) -- and not exits -- (select 1 -- from interval R1 -- ) order by 1 ; select * from serv_res SR where serv_key = 10 and not exists (select 1 from reservation R ) and not exits (select 1 from interval R1 ) order by 1 ; EOF1 The output is as follows: Password for user p2user: serv_key | res_key | start_off_min | duration_min ----------+---------+---------------+-------------- (0 rows) ERROR: syntax error at or near "select" at character 192 LINE 9: (select 1 ^ Note: This is not the actual query I want to run but just kept removing complexity until the problem (multiple sub-selects) seemed obvious. -- View this message in context: http://www.nabble.com/error-with-mor-than-1-sub-select-tf2149934.html#a5936948 Sent from the PostgreSQL - sql forum at Nabble.com.