---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/subquery-comparison.md
cuppy_section: docs
cuppy_doc: 1APS-70PM
cuppy_doc_uuid: faa04e11-2a1d-41a4-b9ff-ad672b1deb4b
cuppy_permalink: https://cuppy.io/salesforce/d/1APS-70PM
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/references/dc-sql-reference/subquery-comparison
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: daeb1728f851605c09af103a665ae78ba3e4faed60959e1f34b28b98d3e4e8b3
# 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/references/dc-sql-reference/subquery-comparison.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.

## Subquery Comparisons

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Subquery comparison expressions are SQL-compliant expressions that compare a value or condition against the rows returned by a subquery. All of the expression forms in this section return boolean results.

*   Except for `EXISTS`, each subquery must return exactly one column.
*   `NULL` values in a subquery can cause a comparison to return `NULL` instead of `TRUE` or `FALSE`. To avoid unexpected results, filter out `NULL` values in your subquery (for example, `WHERE column IS NOT NULL`) when using `ALL` or `NOT IN`.

Check whether a subquery returns any rows:

*   [EXISTS](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/exists.html) — Return true if the subquery returns at least one row.

Compare a value against the set of values returned by a subquery:

*   [IN](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/subquery-in.html) — Return true if the value equals any subquery row.
*   [NOT IN](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/not-in.html) — Return true if the value equals none of the subquery rows.

Apply a comparison operator across the rows returned by a subquery:

*   [ALL](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/all.html) — Return true if the comparison holds for every subquery row.
*   [ANY / SOME](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/any-some.html) — Return true if the comparison holds for any subquery row.

*   [Comparison Operators](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/comparison-func.html)
*   [Scalar Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/scalar-functions.html)


---
<!-- 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 -->
