---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/guide/limit-order-query-results.md
cuppy_section: docs
cuppy_doc: X6CE-6TYA
cuppy_doc_uuid: 6414dc73-e2a0-4599-9973-eeff15ca056f
cuppy_permalink: https://cuppy.io/salesforce/d/X6CE-6TYA
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/guide/limit-order-query-results
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: ce1a5aee2a4dce5e1ac1efb2047c376cb69dae1851ef633e964b165766353bd8
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/guide/limit-order-query-results.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## Limit and Order Your Query Results

A query result set can be large if your Data 360 org contains a lot of data. To limit the query result, use the `LIMIT` clause. The `LIMIT` clause returns the first `n` rows that the data store returns, where `n` is the number of rows specified.

This query returns 20 unified individuals only.

The `LIMIT` clause doesn’t guarantee the order of the rows returned. You can get different results if you run the query at different times. A more reproducible query combines the `LIMIT` clause with the `ORDER BY` clause so that the results returned are in the same order in each query execution.

This query returns the top 20 oldest unified individuals based on the birth date.

This query output shows the first few rows returned for unified individuals from the result set of 20 rows. The rows are ordered by birth date.

| `ssot__FirstName__c` | `ssot__LastName__c` | `ssot__BirthDate__c` |
| --- | --- | --- |
| `Avi` | `Green` | `1937-03-12T00:00:00.000Z` |
| `Babara` | `Levy` | `1940-07-20T00:00:00.000Z` |
| `Edna` | `Frank` | `1945-10-23T00:00:00.000Z` |
| `Stella` | `Pavlova` | `1946-12-04T00:00:00.000Z` |
| `...` | `...` | `...` |

The `ORDER BY` clause orders in ascending order by default. To order the result in descending order, use the `DESC` keyword. This `ORDER BY` clause in the query returns the top 20 youngest individuals.

To retrieve a subset of the returned result set, use `OFFSET` to return the row after the specified row number. Use `OFFSET` with `ORDER BY` to get the same result set in subsequent queries.

Suppose you already displayed the first two rows of the oldest individuals. You want the next two rows. You can use this query with an offset of 2 and a limit of 2.

This query returns rows 3 and 4 from the previous output. The rows are ordered by birth date.

| `ssot__FirstName__c` | `ssot__LastName__c` | `ssot__BirthDate__c` |
| --- | --- | --- |
| `Edna` | `Frank` | `1945-10-23T00:00:00.000Z` |
| `Stella` | `Pavlova` | `1946-12-04T00:00:00.000Z` |


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
