Re: SELECT FROM t1 WHERE id IN (SELECT id FROM t2 UNION SELECT id FROM t3)

From: Tomas Berndtsson <tomas(at)nocrew(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christophe Boyanique <cboyanique(at)formanet(dot)be>, pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT FROM t1 WHERE id IN (SELECT id FROM t2 UNION SELECT id FROM t3)
Date: 2000-11-10 18:10:58
Message-ID: 80vgtvhf4d.fsf@junk.nocrew.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Christophe Boyanique <cboyanique(at)formanet(dot)be> 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.

Is it possible to create a view with UNION and use that in the
sub-select?

Tomas

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message rocael 2000-11-10 19:54:43 special caracters!
Previous Message Christophe Boyanique 2000-11-10 16:45:17 Re: SELECT FROM t1 WHERE id IN (SELECT id FROM t2 UNION SELECT id FROM t3)