---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/conditional-func.md
cuppy_section: docs
cuppy_doc: B91B-WS7P
cuppy_doc_uuid: 6d24bf9b-9563-48e8-8c08-d9427b9f686d
cuppy_permalink: https://cuppy.io/salesforce/d/B91B-WS7P
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/conditional-func
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: ef3759aeb60e7a79ad5f9066551f801b291d4dadd8e7f32f68827e159454b86c
# 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/conditional-func.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.

## Conditional Expressions

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

Conditional expressions select one of multiple result values. Use conditional expressions to:

*   **Branch on conditions** to return different results for different cases.
*   **Substitute defaults** for `NULL` values or convert specific values to `NULL`.
*   **Select the largest or smallest** value from a list of expressions.

*   `CASE` and `COALESCE` evaluate only the subexpressions needed to determine the result. `GREATEST` and `LEAST` evaluate every argument.
*   The data types of all result values must be convertible to a single output type.

Return different results based on conditions:

*   [CASE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/case.html) — Return a result based on the first matching condition or value.
*   [IFF](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/iff.html) — Select an expression based on a Boolean condition; a NULL condition selects the false expression.

Substitute defaults for `NULL` values or convert values to `NULL`:

*   [COALESCE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/coalesce.html) — Return the first non-`NULL` argument.
*   [NVL and IFNULL](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/nvl.html) — Return a replacement when the first expression is NULL; `IFNULL` is an alias of `NVL`.
*   [NULLIF](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/nullif.html) — Return `NULL` when two values are equal.
*   [NULLIFZERO](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/nullifzero.html) — Return NULL when numeric input is zero.
*   [ZEROIFNULL](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/zeroifnull.html) — Return zero when numeric input is NULL.

Choose the largest or smallest value from a list:

*   [GREATEST and LEAST](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/greatest-least.html) — Select the largest or smallest value from a list of expressions.

*   [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 -->
