using INTERSECT and UNION in IN clause - Mailing list pgsql-sql

From Alex Guryanow
Subject using INTERSECT and UNION in IN clause
Date
Msg-id 6585.000822@nlr.ru
Whole thread Raw
Responses tip: weird parse error for pl/pgsql  (Keith Wong <keith@e-magine.com.au>)
Re: using INTERSECT and UNION in IN clause  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hi,

postgresql 7.0.2. Why by executing the following query

select * from magazine
where id in (     select mag_id from dict where word = 'akademie' intersect     select mag_id from dict where word =
'der'intersect     select mag_id from dict where word = 'klasse' )
 

I receive the following error:

ERROR: parse error at or near 'intersect'

while the query
     select mag_id from dict where word = 'akademie' intersect     select mag_id from dict where word = 'der' intersect
   select mag_id from dict where word = 'klasse' )
 

is executed successfully.

Is it possible to use INTERSECT and UNION keywords in subqueries?


Regards,
Alex




pgsql-sql by date:

Previous
From: Joerg Hessdoerfer
Date:
Subject: Re: Continuous inserts...
Next
From: Keith Wong
Date:
Subject: tip: weird parse error for pl/pgsql