* internal function: query.flatten.results