Users who have added tags to topics

Could anyone help me get started toward writing a query that would return the users who have added a specific tag to topics, and number of times they’ve done so during a given date range?

@nixie were you able to write that query you described?

2 Likes

Users who have used a specific tag

@Southpaw it should return the correct result

-- [params]
-- text :tag_name

SELECT tp.user_id, COUNT(tt.tag_id)
FROM topic_tags tt
INNER JOIN tags t ON t.id = tt.tag_id
INNER JOIN topics tp ON tp.id = tt.topic_id
WHERE t.name = :tag_name
GROUP BY tp.user_id, tt.tag_id
4 Likes

Hi @vinothkannans,

Thank you! That appears to return a list of usernames and the number of topics each of those usernames has created that is now tagged “outdated.”

I’m hoping to be able to see who is doing the tagging. I want to challenge my TL3s to a tagging contest to get some outdated topics cleaned up, but I need to be able to keep a score of who does the most tagging.

We’ve been able to do a similar contest in the past “solving” topics, because marking a topic solved is an action_type in user_actions, but I’m not seeing the same kind of data available for adding a tag to a topic.

I was thinking there might be a way to get creative somehow with “last edit” (does tagging count as an edit?) figuring out which user took that action, and maybe matching that timestamp to the “updated” timestamp in topic_tags… but I’m in over my head. :dizzy:

4 Likes