Sql Server Count Distinct Case When