hi there
i have 3 tables for tags, tag categories and used tags. i'm wanting to get a list of all tags with a count of the used tags (the format of the tags used is comma separated values for each document id that has tags).
i've been trying something like this but I can't get the value of the tags.tag field to be inserted into the LIKE statement.
SELECT categories.category, tags.tag,
(SELECT COUNT(id) FROM usedtags WHERE usedtags.value LIKE '%tags.tag%') as numtags
FROM tags
LEFT JOIN categories ON categories.id = tags.category_id
ORDER BY categories.category, tags.tag
There must be a better way to do this but my SQL is not good enough!!
Can someone please point me in the right direction?
Many thanks