Case Statement Sql Using Distinct Count