MySQL Forums
Forum List  »  Newbie

Subqueries and intersect
Posted by: Richard
Date: August 06, 2004 12:13PM

I have two tables

1.titles: Id , Title
2.words: Id , Word

So I have a serie of titles and each title contains a serie of words. Now I would like to find the titles where there are two are more words matching Word in table 2.
I learnt SQL on oracle, and I thought to use a subquery and INTERSECT. Something like:

SELECT Title FROM titles
WHERE Id = (SELECT Id FROM words
WHERE Word = "word1"
INTERSECT
SELECT Id FROM words
WHERE Word = "word2
INTERSECT
SELECT Id FROM words
WHERE Word = "word3");

The "MySQL administrator" gives me next:

Server Information
MySQL Version: MySQL 4.0.18-max-debug
Client Information
Version: MySQL Client Version 5.0.0

As far as I could figure out subqueries are not supported < 4.1. What is this 5.0.0?
And how can I get my query working?

Thanks a lot,

Richard

Options: ReplyQuote


Subject
Written By
Posted
Subqueries and intersect
August 06, 2004 12:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.