So I have a table full of tag keywords.
Tags
------------------
asp
sql
html
and a table full of posts
posts
------------------
I really like ASP
This week with stuff about ASP
This post contains SQL
I want to display the top 10 tags in order of most unique posts containing occurrences in the posts table.
This is what I have but it is rubbish, I am ashamed.
SELECT Tag,(SELECT Count(*) FROM Posts WHERE post LIKE '%Tags.Tag%') As Mentions FROM Tags ORDER BY Mentions DESC
Please help! I know there is some sort of mystical UNION or GROUP BY I am missing here.
1 Answer