allow local scope in conditional query expressions (if param then joins where expr)