If you are retrieving data from a pure relational database, you should see if you can get multiple result sets in a single query. Alternatively, if you can get dangling results, extract them in a tree structure with the appropriate shape.
If your database connection is not enough for this, you can use the universal join of the results and then return the join query marked in some form to determine which result is from which table.
You did not specify a reason for decreasing rounding, but you can also use something like a stored procedure to collect the necessary data on the server and then return it to a single result set.
Pekka source share