Hello,
I have a two tables created to apply keywords to a given entry:
Table: File
FileID (int, pk, auto incr)
Name (varchar)
Table File_Keyword
KeywordID (int, pk, auto incr)
FileID (fk)
Keyword (varchar)
Given that I have a record in table File with 2 corresponding records in table File_Keyword assigning keywords "ABC" and "XYZ" to the given FileID.
What is a simple sql query to only return results if both strings are matched:
SELECT file.FileID WHERE file.FileID=file_keyword.FileID AND (file_keyword.Keyword LIKE '%ABC%' AND file_keyword.Keyword LIKE '%XYZ%');
Any assistance would be appreciated.
Thank you in advance.