Chain the call with the previous one rather than running the same query multiple times