Transfer join conditions to where clause in case of left/right outer joins