When I run this query, I get the result that I need.
But, when I run this query, I am trying to also list the NAMES that are distinct, that are > 1, why do I get NO ROWS RETURNED?
Code:
Select PHONE, COUNT(DISTINCT(NAME)) from TABLE
where PHONE = '1234567879'
group PHONE
Having COUNT(DISTINCT(NAME)) > 1
PHONE COUNT(DISTINCT(NAME))
-------------------- ---------------------------
123456789 3
But, when I run this query, I am trying to also list the NAMES that are distinct, that are > 1, why do I get NO ROWS RETURNED?
Code:
Select NAME, PHONE, COUNT(DISTINCT(NAME)) from TABLE
where PHONE = '123456789'
group by NAME, PHONE
Having COUNT(DISTINCT(NAME)) > 1
no rows selected