>Yes he says as the task but code doesn't match to task at all. Queries same tables N times.
You are misreading the code.
(laOffice(o, 2) + "client")
will evaluate to a different path each time, because the value of "o" in the array reference changes from 1 to 7, pointing to different paths for the 7 different offices.