---
schema_version: "1"
id: 6277bac4ce179e8fc6f4d63b24535013ed9fcf9193373d68b9949e36a96bb623
title: "Result Modes: ONE ROW PER MATCH and ONE ROW PER STEP"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/pgq/result-modes.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/result-modes.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ba405ee48dfb7274189b2343eed5ea4913ae6016df1303121c5a674772811dcd
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# Result Modes: ONE ROW PER MATCH and ONE ROW PER STEP

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

`GRAPH_TABLE` can return a path in two shapes.

- `ONE ROW PER MATCH` (the default): one row for the whole path.
- `ONE ROW PER STEP`: one row for each hop along the path.

Result modes matter most when a path can be more than one hop.

```sql
GRAPH_TABLE ( <graph>
    MATCH <pattern> [WHERE <condition>]
    [ ONE ROW PER MATCH
    | ONE ROW PER STEP ( <src_var>, <edge_var>, <dst_var> ) ]
    COLUMNS ( <column>[, ...] )
)
```

Put the result-mode clause after `MATCH` and before `COLUMNS`.

Use these with the commerce graph from [Defining a Property Graph](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/define-property-graph.md).

## One Row for the Whole Path

Use `ONE ROW PER MATCH` when you want one answer per walk, such as one row for each product Avery can reach.

```sql
WITH pg AS PROPERTY GRAPH (...)
SELECT * FROM GRAPH_TABLE(pg
    MATCH (i:individual)-[]-{2,4}(product:product)
    ONE ROW PER MATCH
    COLUMNS (
        i.name AS individual_name,
        product.name AS product_name
    )
) AS gt;
```

The pattern omits the edge label so `customerOrder` and `orderProduct` can both match. One row per walk, no matter how many hops. Avery → Order 100 → Trail Shoes is the two-hop case.

## One Row for Each Hop

Use `ONE ROW PER STEP` when you want to see each connection in the walk. A two-hop path returns two rows.

Name each iterator in the parentheses, in written order: the starting vertex, the edge, and the ending vertex.

| Position | Role | Binds to                           |
| -------- | ---- | ---------------------------------- |
| 1st      | From | The vertex written before the edge |
| 2nd      | Edge | The connection for that hop        |
| 3rd      | To   | The vertex written after the edge  |

Read those names in `COLUMNS` the same way you read `i.name`. Don't use them in `WHERE`. A `WHERE` filters the whole path, not one hop.

The names follow the written pattern, not the physical source and destination of the edge table. For a left-pointing edge (`<-`), the first name is still the vertex you wrote first.

```sql
WITH pg AS PROPERTY GRAPH (...)
SELECT source_name, created_date, quantity, destination_name
FROM GRAPH_TABLE(pg
    MATCH (i:individual)-[]-{2,4}(product:product)
    ONE ROW PER STEP (from_el, relationship, to_el)
    COLUMNS (
        from_el.name AS source_name,
        relationship.createdDate AS created_date,
        relationship.quantity,
        to_el.name AS destination_name
    )
) AS gt;
```

The pattern omits the edge label so `customerOrder` and `orderProduct` can both match. If Avery's Order 100 contains two pairs of Trail Shoes, the two-hop path is `Avery -> Order 100 -> Trail Shoes` and produces two rows. The customer-to-order hop has no `quantity`, so that value is `NULL` on the first row.

| source_name | created_date | quantity | destination_name |
| ----------- | ------------ | -------- | ---------------- |
| Avery       | 2026-08-01   | _NULL_   | Order 100        |
| Order 100   | 2026-08-01   | 2        | Trail Shoes      |

Rows follow the written walk (Avery → Order 100, then Order 100 → Trail Shoes), not the edge table's `SOURCE`/`DESTINATION`.

## Rules

- The three step variables must be new and distinct. Don't reuse `i`, `order`, or `product`.
- `ONE ROW PER STEP` allows only one path pattern in `MATCH`.
- On a pattern with no edges, only the first variable binds. Referencing the edge or destination variable is an error.
- A variable bound to one vertex stays the same on every step of that match. A variable on a repeated edge isn't available in `COLUMNS`.

## Related Documentation

- [Querying with GRAPH_TABLE and MATCH](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/graph-table-match.md)
- [Path Patterns and Quantifiers](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/path-patterns.md)
- [Property Graph Queries (PGQ)](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/pgq-context.md)
