SQL problem
People, please explain me!!!
SQL 92
Example:
T1 (ID,Name, Date)
T2 (IDKEY, IDMAIN)
T3 (ID, Word)
T2.IDMAIN = T1.ID
T2.IDKEY = T3.ID
Want to find all the records to wich corresponds all entered by me words.
SELECT DISTINCT Main.Name, Main.Data, Main.Form, Main.Place, Main.Source, Main.Language, Main.Author
FROM "main.db" Main
INNER JOIN "idkey.db" Idkey
ON (Main.ID = Idkey.IDMain)
INNER JOIN "keywords.db" Keywords
ON (Idkey.IDKey = Keywords.ID)
WHERE (UPPER( Keywords.Text ) LIKE UPPER( '%%%keyword1%' ))
AND (UPPER( Keywords.Text ) LIKE UPPER( '%%%keyword2%' ))
it finds nothing. I uderstand why - there is no record that posses two meenings at the same time. If I'll write OR it will find all records having keyword1 and having keyword1. But I need records having both words at the same time!
Thank you
|