Sql Case When In Join Statement In Python With Example