Re: error with mor than 1 sub-select

From: Osvaldo Kussama <osvaldo_kussama(at)yahoo(dot)com(dot)br>
To: chrisj <chrisj(dot)wood(at)sympatico(dot)ca>, pgsql-sql(at)postgresql(dot)org
Subject: Re: error with mor than 1 sub-select
Date: 2006-08-23 02:03:51
Message-ID: 20060823020351.85246.qmail@web60816.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

chrisj <chrisj(dot)wood(at)sympatico(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2006-08-23 02:06:43 Re: error with mor than 1 sub-select
Previous Message Michael Glaesemann 2006-08-23 01:54:38 Re: SQL92 compliance