I am not sure quite how to word this question, I have found it rather difficult to explain and even more so to find the right words to google for.
I have a simple search results page for a few articles that my company has up. I am implementing a "tag" system for them. Everything is working, but now on the search results page I would like to display all of the tags for the article. The way I am doing it now I am sure is not the best or even remotely close. I get the search results then, for each result, I do another statement to get the list of Tags from the tags table. Is there a way I can get this into one query?
My results query is as follows:
SELECT tblMagazineArticles.articleID, tblMagazineArticles.title, tblMagazineArticles.description, tblMagazineArticles.subTitle, tblMagazineArticles.oneLiner, tblMagazineSections.sectionTitle, tblMagazineIssues.issueTitle FROM tblMagazineArticles JOIN CONTAINSTABLE( tblMagazineArticles, *, ?) as KEY_TBL ON tblMagazineArticles.articleID = KEY_TBL.[KEY] JOIN tblMagazineSections ON tblMagazineArticles.sectionID = tblMagazineSections.sectionID JOIN tblMagazineIssues ON tblMagazineIssues.issueID = tblMagazineArticles.issueID ORDER BY KEY_TBL.RANK DESC
fairly simple, but then from the ArticleID I perform the other queries to get the related tags. Any suggestions?