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 BE4E69FB2B6 for ; Tue, 22 Aug 2006 23:06:57 -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 31974-08 for ; Tue, 22 Aug 2006 23:06:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id A54899FB233 for ; Tue, 22 Aug 2006 23:06:48 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k7N26hZR029624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Aug 2006 20:06:46 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k7N26hWS060320; Tue, 22 Aug 2006 20:06:43 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k7N26h4W060319; Tue, 22 Aug 2006 20:06:43 -0600 (MDT) (envelope-from mfuhr) Date: Tue, 22 Aug 2006 20:06:43 -0600 From: Michael Fuhr To: chrisj Cc: pgsql-sql@postgresql.org Subject: Re: error with mor than 1 sub-select Message-ID: <20060823020643.GA60275@winnie.fuhr.org> References: <5936948.post@talk.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5936948.post@talk.nabble.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.229 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/160 X-Sequence-Number: 26118 On Tue, Aug 22, 2006 at 06:47:51PM -0700, chrisj wrote: > 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 Does the real query have "exits" instead of "exists"? I created some test tables and fixed that typo and then both queries worked. -- Michael Fuhr