How To Use Case Statement In Join Condition