sql - Count of distinct groups that have a value of > 0 in any of its records for a given column -
the 2 columns:
a) company name. there can multiple records company: 1 record per company per month.
b) sales. given company given month, sales value 0 or greater.
what want query return:
a count of distinct companies had sales of > 0 one or more months
thanks in advance help!
something similar to:
select count(distinct companyid) salestable sales > 0
simply count number of distinct companyid's have sales > 0.
Comments
Post a Comment