I have the following tables:
tags
id tag_name
examples
id category heading
examples_tags
id tag_id example_id
How can I retrieve the number of examples under each tag? (a bit like stackoverflow actually :))
I also want an additional condition of the type: examples.category = "english examples"
This is how I started ...
SELECT tags.id, tags.tag_name, COUNT( examples_tags.tag_id ) AS 'no_tags'
WHERE tags.id = examples_tags.tag_id
&&
examples.category = 'english examples'
GROUP BY tags.id
Thanks .