depends on the destination query but in short you need to
1) duplicate the source query internal schema (fieldDefs, and fields collections)
2) call query1.createdataset to create the internal buffers.
3) write a loop to copy each row of the source query field by field to an appended row on the destination query.