Case Statement Sql Using Distinct In Sql