Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6NGxQf59253 for ; Mon, 23 Jul 2001 12:59:26 -0400 (EDT) (envelope-from pgsql-general-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6NEVWf83746; Mon, 23 Jul 2001 10:31:32 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f6NERCo66359; Mon, 23 Jul 2001 10:27:12 -0400 (EDT) (envelope-from news) From: Raymond Chui X-Newsgroups: comp.databases.postgresql.general,comp.databases.postgresql.sql Subject: What's wrong with this syntax? Date: Mon, 23 Jul 2001 10:00:46 -0400 Organization: Department of Commerce/NOAA/NWS Lines: 53 Message-ID: <3B5C2E0E.15F32C2C@noaa.gov> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------82699FC7C82E504B6717B8E7" X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en To: pgsql-general@postgresql.org.pgsql-sql@postgresql.org X-Archive-Number: 200107/846 X-Sequence-Number: 12960 This is a multi-part message in MIME format. --------------82699FC7C82E504B6717B8E7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 --------------82699FC7C82E504B6717B8E7 Content-Type: text/x-vcard; charset=us-ascii; name="raymond.chui.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Raymond Chui Content-Disposition: attachment; filename="raymond.chui.vcf" 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 --------------82699FC7C82E504B6717B8E7--