--- title: "Retrieve hierarchical query results" slug: "retrieve-hierarchical-query-results" tags: ["Reference", "ePO 5.10.x", "ePO 5.10.0", "ePolicy Orchestrator – On-prem"] updated: 2026-09-07T17:35:57Z published: 2026-09-07T17:35:57Z canonical: "docs.trellix.com/retrieve-hierarchical-query-results" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.trellix.com/llms.txt > Use this file to discover all available pages before exploring further. # Retrieve hierarchical query results Queries involving joined tables can return results in a hierarchy. The `core.executeQuery` command can also be used in `joinTables` mode. In this mode, you specify only the tables you want joined. The results of the query are used as keys to perform a subquery for all related results from the joined table. The joined table creates a hierarchical result set that could contain nested results. The nested results level depends on how many join tables are specified. To join tables using `core.executeQuery`, you specify a comma-separated list of tables to join as the `joinTables` parameter. You do not specify a select parameter when joining tables. The results are returned as a result hierarchy with each record of the parent table becoming the parent node of the related records in each child table. The hierarchy continues until all joined tables are displayed. ### Example This example executes a simple join between the `OrionTaskLog` and the `OrionTaskLogMessage` tables. ``` OK:     New Task   2010-11-23T13:01:37-08:00   2010-11-23T13:01:37-08:00   ga   0   scheduler   493                Purge audit log              Purge audit log (Purge log records older than: 1 days)             ``` This output shows the `core.executeQuery` command returned each top-level object (the `OrionTaskLogTask` record) and its two associated message records. The output is shown as XML to highlight the hierarchical arrangement of the results.