結果 : join condition based on case statement in sql