Skip site navigation (1) Skip section navigation (2)

using INTERSECT and UNION in IN clause

From: Alex Guryanow <gav(at)nlr(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: using INTERSECT and UNION in IN clause
Date: 2000-08-22 10:03:42
Message-ID: 6585.000822@nlr.ru (view raw or flat)
Thread:
Lists: 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



Responses

pgsql-sql by date

Next:From: Brian C. DoyleDate: 2000-08-22 10:47:19
Subject: Time Help
Previous:From: Joerg HessdoerferDate: 2000-08-22 07:44:02
Subject: Re: Continuous inserts...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group