Im still trying to learn more complex SQL queries and am finding it difficult to return my desired results.
The user will input one or more keywords, and the query will return topics based on the limitations put in place through the keywords:
Example DB:
Tables:
keywords
-------
keyword_id
keyword
topics
-------
topic_id
topic_other_stuff
topics_keywords
-------
tk_id
topic_id
keyword_id
Each topic_id can have multiple keywords attached to it.
If the user inputs 2 or more keywords, I am trying to get a query that returns only topics that have both keywords attached to it via the topics_keywords table.
Any help would be appreciated!
Thanks!
1 Answer