Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAAGacs32501 for ; Fri, 10 Nov 2000 11:36:38 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eAAGZcd11650; Fri, 10 Nov 2000 11:35:39 -0500 (EST) To: Christophe Boyanique cc: pgsql-sql@postgresql.org Subject: Re: SELECT FROM t1 WHERE id IN (SELECT id FROM t2 UNION SELECT id FROM t3) In-reply-to: <3A0C2193.DB793E1B@formanet.be> References: <3A0C2193.DB793E1B@formanet.be> Comments: In-reply-to Christophe Boyanique message dated "Fri, 10 Nov 2000 17:25:55 +0100" Date: Fri, 10 Nov 2000 11:35:38 -0500 Message-ID: <11647.973874138@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/86 X-Sequence-Number: 117 Christophe Boyanique writes: > SELECT idProduct FROM products > WHERE idProduct IN > (SELECT id FROM orders WHERE ts>'2000-10-01 17:04:00' > UNION SELECT id FROM preorders WHERE ts>'2000-10-01 17:04:00') > ORDER by name; > and I've got a parse error near UNION or SELECT depending of the Current releases don't handle UNION in sub-selects. 7.1 will. In the meantime, consider doing the UNION into a temp table and then using that for the IN operator. regards, tom lane