X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D566F9FB300 for ; Tue, 22 Aug 2006 23:10:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 36385-06 for ; Wed, 23 Aug 2006 02:10:32 +0000 (UTC) X-Greylist: delayed 00:06:35.596732 by SQLgrey- Received: from web60816.mail.yahoo.com (web60816.mail.yahoo.com [209.73.178.224]) by postgresql.org (Postfix) with SMTP id 5A41F9FB2B6 for ; Tue, 22 Aug 2006 23:10:32 -0300 (ADT) Received: (qmail 85248 invoked by uid 60001); 23 Aug 2006 02:03:51 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZB/f0ptU30E3M/XItf1uHGXXO6u/uE4EJeRbBCnalVJqRkvLEHFveo+QZLVTdYT9f05D9KVUo76sy3Kbsm4U61vehcEYNXs3E77wul1zM5Y6btchjbJYTxPhF2FIsmZEbF5NUIkfzoS/liLBXIaaGZmGWb2NaQpQwI79x6NpOaQ= ; Message-ID: <20060823020351.85246.qmail@web60816.mail.yahoo.com> Received: from [201.53.41.28] by web60816.mail.yahoo.com via HTTP; Tue, 22 Aug 2006 23:03:51 ART Date: Tue, 22 Aug 2006 23:03:51 -0300 (ART) From: Osvaldo Kussama Subject: Re: error with mor than 1 sub-select To: chrisj , pgsql-sql@postgresql.org In-Reply-To: <5936948.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-744882807-1156298631=:83751" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.313 tagged_above=0 required=5 tests=HTML_40_50, HTML_MESSAGE, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: **** X-Archive-Number: 200608/161 X-Sequence-Number: 26119 --0-744882807-1156298631=:83751 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit chrisj escreveu: 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 exi*S*ts (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. []s Osvaldo --------------------------------- Yahoo! Search Música para ver e ouvir: You're Beautiful, do James Blunt --0-744882807-1156298631=:83751 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit

chrisj <chrisj.wood@sympatico.ca> escreveu:

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

exi*S*ts

(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.




[]s
Osvaldo


Yahoo! Search
Música para ver e ouvir: You're Beautiful, do James Blunt --0-744882807-1156298631=:83751--