Ad Code

COUNT DISTINCT with CONDITIONS in MYSQL

SELECT

  count(distinct tag) as tag_count,

  count(distinct (case when entryId > 0 then tag end)) as positive_tag_count

FROM

  your_table_name;



Post a Comment

0 Comments