Re: SQL question - problem with INTERSECT
- From: Igor Roboul <igor(at)raduga(dot)dyndns(dot)org>
- To: PGSQL-General <pgsql-general(at)postgresql(dot)org>
- Subject: Re: SQL question - problem with INTERSECT
- Date: Wed, 1 Nov 2000 07:58:04 +0300
- Message-id: <20001101075804.A10542@linux.rainbow> <text/plain>
On Mon, Oct 30, 2000 at 07:59:06PM -0500, Keith L. Musser wrote:
> "(SELECT messages.msgid FROM messages, subject_index WHERE
> ((subject_index.word='Hello' or subject_index.word='There') and
> (subject_index.msgid = messages.msgid))
> GROUP BY messages.msgid HAVING count(messages.msgid)=2)
> INTERSECT
> (SELECT messages.msgid FROM messages, author_index WHERE
> ((author_index.word='Jim' or author_index.word='Jones') and
> (author_index.msgid = messages.msgid))
> GROUP BY messages.msgid HAVING count(messages.msgid)=2);"
Try removing first "GROUP BY messages.msgid HAVING count(messages.msgid)=2)"
--
Igor Roboul, Unix System Administrator & Programmer @ sanatorium "Raduga",
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744
Home |
Main Index |
Thread Index