I want to count the number of distinct items in a column subject to a certain condition, for example if the table is like this:
tag | entryID ----+---------
This may work:
SELECT Count(tag) AS 'Tag Count' FROM Table GROUP BY tag
and
SELECT Count(tag) AS 'Negative Tag Count' FROM Table WHERE entryID > 0 GROUP BY tag