I've a table called keywords that holds keywords that have been assigned to record albums. I want to create a tag cloud that lists each keyword just once. The keyword table has a many to many relationship with the music albums. If 500 albums have been tagged "folk rock", then folk rock is in the database 500 times, but I only want it to appear once. I also want to get a count of how many times it appears. In the past, I thought I've simply done this:
SELECT keyword, COUNT(*) as howMany
GROUP BY keyword
ORDER BY howMany
However, this is not working. As you can see here on this page, words like "folk" are appearing several times, and "howMany" is always equal to 1.