I have three db tables and I'd like to select the 10 most used tags from song_tag table, which I can do with the sql query below
SELECT `tag_id`,
COUNT(`tag_id`) AS `value_occurrence`
FROM `song_tag`
GROUP BY `tag_id`
ORDER BY `value_occurrence` DESC
LIMIT 10;
How would I then get the tag name value from the tags table in the same query? Is it even possible? I have set up a fiddle with some dummy data and the three tables that are needed.(link at top of post).
This will be used in a wordpress wpdb query. I don't think there is much else to add about configuration setup, languages etc.