parameterized leftjoin and rightjoin