Du bör kunna få det med GROUP BY klausul: SELECT tagName, count(tagName) AS tagCount FROM tagTable GROUP BY tagName