From: Raymond Chui <raymond.chui@noaa.gov>
To: pgsql-general@postgresql.org.pgsql-sql
Subject: What's wrong with this syntax?
Date: Mon, 23 Jul 2001 10:00:46 -0400
Message-ID: <3B5C2E0E.15F32C2C@noaa.gov> (raw)
SELECT id_1 FROM table1 WHERE state_code IN ('AZ','DE')
UNION
SELECT id_1 FROM table1 WHERE zip_code IN ('12345','54321');
Above SQL statement running fine.
Now I added
SELECT id_2 FROM table2 WHERE id_1 IN (
SELECT id_1 FROM table1 WHERE state_code IN ('AZ','DE')
UNION
SELECT id_1 FROM table1 WHERE zip_code IN ('12345','54321')
);
Now I got parse error at or near "union"
Please tell me what's wrong with the 2nd SQL statement.
Thank you!
--Raymond
Attachments:raymond.chui.vcf (text/x-vcard, 413B) download
begin:vcard
n:Chui;Raymond
tel;fax:(301)713-0963
tel;work:(301)713-0624 Ext. 168
x-mozilla-html:TRUE
url:http://members.xoom.com/rchui/
org:NWS, NOAA
version:2.1
email;internet:Raymond.Chui@noaa.gov
title:SA, DBA
note:ICQ #: 16722494
adr;quoted-printable:;;NOAA, NWS, Office of Hydrology, OH=0D=0A1325 East-West Highway, Room 8112;Silver Spring;MD;20910-3283;U.S.A.
x-mozilla-cpt:;-6384
fn:Raymond Chui
end:vcard
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: raymond.chui@noaa.gov, pgsql-general@postgresql.org.pgsql-sql
Subject: Re: What's wrong with this syntax?
In-Reply-To: <3B5C2E0E.15F32C2C@noaa.gov>
* 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