SELECT tag.name, COUNT(tag_webobject.tag_id) AS number FROM tag_webobject GROUP BY tag_webobject.tag_id LEFT JOIN tag ON tag_webobject.tag_id=tag.id;