Ms Sql Case Count Distinct