pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chrisj <chrisj.wood@sympatico.ca>
To: pgsql-sql@postgresql.org
Subject: error with mor than 1 sub-select
Date: Tue, 22 Aug 2006 18:47:51 -0700 (PDT)
Message-ID: <5936948.post@talk.nabble.com> (raw)


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.




view thread (5+ messages)  latest in thread

Message-ID: <5936948.post@talk.nabble.com>
Permalink:  ../5936948.post@talk.nabble.com/
Also on:    postgresql.org/message-id/5936948.post@talk.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chrisj.wood@sympatico.ca
  Subject: Re: error with mor than 1 sub-select
  In-Reply-To: <5936948.post@talk.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox