Sql Count Case When Distinct