Count Distinct Case When In Sql