Ms Sql Case Count Distinct Elements