---
title: "Workday WQL vs SQL: Syntax, WHERE Operators & Limits"
description: "How Workday Query Language compares to SQL: WHERE equality syntax, RBO traversal instead of JOINs, data source filters, and unsupported SQL features."
url: https://kiweely.com/guides/workday-wql-vs-sql-syntax-differences-limitations
---

# Workday WQL vs SQL: Syntax, WHERE Operators, and Limitations

WQL borrows SQL clause order (SELECT, FROM, WHERE, GROUP BY, ORDER BY) but executes against Workday’s object-graph reporting engine rather than relational tables. This guide covers exact WQL WHERE syntax, Related Business Object traversal, and the SQL features WQL omits.

-   **Checked** against Workday on December 5
-   Applies to **Workday Extend**
-   6 min read
-   Published December 5
-   By Kiweely

Workday Query Language (WQL) copies SQL’s declarative clause order (`SELECT`, `FROM`, `WHERE`, `GROUP BY`, `HAVING`, `ORDER BY`, `LIMIT`), so anyone who writes SQL can read a WQL query immediately. Underneath that surface, WQL is a read-only query layer over Workday’s object-graph reporting engine, not a relational database engine: it has no `JOIN`, `UNION`, `CASE`, subqueries, `SELECT *`, or write statements (`INSERT`, `UPDATE`, `DELETE`).

## How WQL Logic Differs from Relational SQL

In standard SQL, the query planner executes set-based relational algebra across normalized tables using arbitrary join keys. In Workday WQL, every query targets a single Workday **data source** (or a table-backed Prism data source prefixed with `cds_`), which is bound to one Primary Business Object (PBO) and its pre-defined Related Business Objects (RBOs).

Execution is also governed by Workday’s security model and reporting limits rather than database-level table grants:

-   Every field and data source is filtered at runtime by the calling user’s or Integration System User’s Workday security domains.
-   A single WQL query cannot return more than **1 million rows**; queries exceeding that ceiling fail unless narrowed.
-   Query execution times out after **30 minutes** on tenanted hosts and **5 minutes** through the Workday Cloud Platform API gateway (`api.workday.com`).

## Side-by-Side Comparison: WQL vs Standard SQL

| Capability | Standard SQL | Workday WQL |
| --- | --- | --- |
| Wildcard columns | `SELECT *` | Not supported; every field alias must be named explicitly |
| Column aliasing | `field AS alias` | `field AS alias` (required to disambiguate multiple fields from the same RBO) |
| Data target | Table or view (`FROM workers`) | Workday data source with optional filter and prompts (`FROM workersForHCMReporting(dataSourceFilter = allActiveWorkers)`) |
| Joining related data | `INNER JOIN` / `LEFT JOIN` on arbitrary keys | Pre-wired RBO traversal with curly braces in `SELECT` (`location{locationName}`) and `WHERE ON` for filtering |
| Equality and inequality | `=`, `!=`, `<>` | `=`, `!=`, `<>` |
| Null checks | `IS NULL`, `IS NOT NULL` | `is empty`, `is not empty` |
| Pattern matching | `LIKE '%text%'` | Case-insensitive `contains`, `not contains`, `startswith`, `endswith` |
| Set membership | `IN ('a', 'b')` | `IN ('wid1', 'wid2')` or `IN (inst_refId = "USA")` for instances |
| Distinct values | `SELECT DISTINCT col` | Only inside `COUNT(DISTINCT field)` |
| Conditional logic | `CASE WHEN ... THEN ... END` | Not supported in WQL (build a Workday calculated field instead) |
| Set operations and nesting | `UNION`, `INTERSECT`, subqueries, CTEs | Not supported |
| Pagination | `LIMIT` and `OFFSET` clauses | `LIMIT` in query (`1` to `999,999`); REST API URL parameters `limit` (max `10,000` per page) and `offset` |
| Data modification (DML/DDL) | `INSERT`, `UPDATE`, `DELETE`, `CREATE` | Read-only; mutations require Workday REST or SOAP APIs |

## WQL `WHERE` Equality and Filter Syntax

WQL’s `WHERE` clause evaluates Boolean expressions using `AND`, `OR`, and parentheses `( )` to control precedence (parenthesized expressions evaluate first). Literal formatting depends on the field’s Workday data type:

-   **Text fields:** wrap string literals in single quotes (`WHERE status != 'Terminated'`).
-   **Boolean and numeric fields:** leave literals unquoted (`WHERE isActive = true`, `WHERE yearsOfService >= 5`).
-   **Date fields:** convert string dates with `TO_DATE` (`WHERE accounting_Date <= TO_DATE('2026-01-01', 'yyyy-MM-dd')`).
-   **Empty checks:** use `is empty` or `is not empty` instead of `IS NULL` (`WHERE terminationDate is empty`). Both operators work across Boolean, Date, Instance, Numeric, and Text fields.
-   **Substring checks:** use `contains`, `not contains`, `startswith`, or `endswith` instead of `LIKE`. All four are case-insensitive (`WHERE businessTitle contains 'Manager'`, `WHERE businessTitle endswith 'Lead'`).
-   **Workday IDs (WIDs) and Reference IDs:** use `IN (...)` to match instance fields against 32-character hexadecimal WIDs or reference IDs (`inst_refId = "referenceID"`, where the double quotes around the reference ID are optional).

### Example 1: Equality, Boolean, and Text Filters

wql

```
SELECT employeeID, legalName_lastName, businessTitle, hireDate
FROM allWorkers
WHERE isActive = true
  AND (businessTitle contains 'Engineer' OR businessTitle contains 'Architect')
  AND terminationDate is empty
ORDER BY hireDate DESC
```

### Example 2: Filtering by WID or Reference ID (`IN`)

wql

```
SELECT worker, employeeID, location
FROM allWorkers
WHERE locationCountry IN (inst_refId = "USA")
  AND location IN ('0c0bbf2e124810a26765415bb08406c5', '4a9f10c3b81210a26765415bb08407d1')
```

Each WID inside `IN (...)` must be an individual item. Passing a comma-separated string inside a single pair of quotes (`IN ('wid1,wid2')`) fails with HTTP `400 Bad Request` (`Specify a valid value for the field`).

## Traversing Related Business Objects Instead of `JOIN`

WQL replaces SQL `JOIN` statements with Related Business Object (RBO) traversal. In the `SELECT` clause, reference fields on a related object by placing the related field inside curly braces `{}` after the RBO link field, and add a unique `AS` alias when selecting multiple fields from the same RBO.

To filter rows based on an RBO field (including multi-instance fields such as `dependents`), place a `WHERE ON` clause immediately after `FROM` and before any primary `WHERE` clause. Omit the curly braces inside `WHERE ON`.

### Example 3: Selecting and Filtering a Related Business Object

wql

```
SELECT
  worker,
  dependents{legalName_FirstName} AS dependentFirstName,
  dependents{age} AS dependentAge
FROM allWorkers
WHERE ON dependents age < 18
WHERE isActive = true
```

When sending a WQL query in a `GET` request query string, REST clients that do not automatically encode URLs require `{` and `}` to be percent-encoded as `%7B` and `%7D`.

## Data Source Filters and Prompt Parameters (`FROM` and `PARAMETERS`)

Unlike SQL tables, many Workday data sources expose built-in **data source filters** and **prompt parameters** that restrict records before the `WHERE` clause runs. You can pass prompt values either inside the `FROM` clause parentheses or in a leading `PARAMETERS` clause, but never in both places in the same query, and each parameter may appear only once.

### Example 4: Data Source Filter with Inline Prompt Parameters

wql

```
SELECT worker, businessTitle, employeeID, hireDate
FROM workersForHCMReporting(
  dataSourceFilter = allActiveWorkers,
  location = ("0c0bbf2e124810a26765415bb08406c5")
)
ORDER BY employeeID ASC
```

The same query can move the prompt into a `PARAMETERS` block while keeping `dataSourceFilter` inside `FROM`:

wql

```
PARAMETERS location = ("0c0bbf2e124810a26765415bb08406c5")
SELECT worker, businessTitle, employeeID, hireDate
FROM workersForHCMReporting(dataSourceFilter = allActiveWorkers)
ORDER BY employeeID ASC
```

## Aggregation, `GROUP BY`, `HAVING`, and Pagination

WQL supports `AVG()`, `COUNT()`, `COUNT(DISTINCT field)`, `MAX()`, `MIN()`, and `SUM()` in `SELECT` and `HAVING`. Percentile functions are not supported.

-   **`GROUP BY` restrictions:** WQL cannot group by aggregated fields, currency fields, or multi-instance fields.
-   **`HAVING`:** requires a `GROUP BY` clause and filters aggregated groups (for example, `HAVING count() > 100`).
-   **`LIMIT` vs REST `limit` and `offset`:** An in-query `LIMIT` clause accepts an integer from `1` to `999,999`, but Workday still evaluates the full result set before truncating it, so `LIMIT` does not improve backend execution speed. To page through large datasets via `/wql/v1/data`, use the REST query parameters `limit` (up to `10,000` rows per page) and `offset` (0-based starting row). For a full walkthrough of large result pagination, see [How to return more than 500 rows in WQL](https://kiweely.com/guides/wql-more-than-500-rows).

For quick syntax lookup across clauses, keep the [Workday WQL Cheat Sheet](https://kiweely.com/guides/workday-wql-cheat-sheet) handy.

## Common Errors SQL Developers Hit in WQL

1.  **Writing `SELECT *`:** WQL rejects wildcard projections. Every column must use its exact Workday WQL field alias; if you do not know an alias, build a quick Custom Report and run the Workday task **Convert Report to WQL**.
2.  **Using `IS NULL` or `LIKE`:** Replace `IS NULL` / `IS NOT NULL` with `is empty` / `is not empty`, and replace `LIKE` with `contains`, `not contains`, `startswith`, or `endswith`.
3.  **Filtering an RBO in the main `WHERE` clause:** Writing `WHERE dependents{age} < 18` or `WHERE dependents is not empty` fails validation (such as `can only be used as a related business object field (RBO)`). Move RBO filters into `WHERE ON <rboAlias> <field> ...`.
4.  **Duplicating prompt parameters across `PARAMETERS` and `FROM`:** Supply data source filter prompts in one location only, or the query fails validation.
5.  **Assuming `LIMIT 10` speeds up a slow query:** Because WQL computes the full result set before applying `LIMIT`, always narrow the dataset with an indexed `dataSourceFilter` or selective `WHERE` conditions first.
6.  **Expecting `CASE` or subqueries to reshape data:** WQL does not evaluate conditional branching or nested queries. Create a Workday calculated field for conditional logic and query that field’s WQL alias, or perform joins and transformations downstream.

## Sources checked

-   [Workday Documentation: Concept: Workday Query Language (WQL)](https://developer.workday.com/documentation/GUID-6546152a-bcf0-447d-8d64-230f9e2ac291-enHYPHENus/ConceptWorkdayQueryLanguageWQL)
-   [Workday Documentation: WQL SELECT Clause Reference](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/wif1611189270836.html)
-   [Workday Documentation: WQL FROM Clause Reference](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/kba1611189724822.html)
-   [Workday Documentation: WQL WHERE Clause Reference](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/fsf1611267464081.html)
-   [Workday Documentation: WQL WHERE ON Clause Reference](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/czb1657128437777.html)
-   [Workday Documentation: WQL PARAMETERS Clause Reference](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/wql-reference/trh1644452418127.html)
-   [Workday Documentation: WQL LIMIT and Result Limits Reference](https://doc.workday.com/admin-guide/en-us/reporting-and-analytics/custom-reports-and-analytics/workday-query-language-wql-/future--reference--wql-result-limits.html)

## Related guides

[All guides](https://kiweely.com/guides)

### More guides on WQL

[All 44 guides](https://kiweely.com/guides#wql)

-   [Workday WQL WHERE Syntax: = Equality, OR Logic, and lastFunctionallyUpdated](https://kiweely.com/guides/workday-wql-lastfunctionallyupdated-or-filter-syntax)
-   [Workday WQL Alias Naming Rules and Restrictions](https://kiweely.com/guides/workday-wql-alias-naming-rules-and-restrictions)
-   [Fix Workday WQL ExternalFieldException: Convert Currency Field Did Not Find a Currency Conversion Rate](https://kiweely.com/guides/workday-wql-convert-currency-external-field-exception)
-   [Does Workday WQL Support SELECT \*? How to List Data Source Fields](https://kiweely.com/guides/workday-wql-select-star-wildcard)
-   [Workday to Snowflake and Databricks: Comparing Data Cloud, Prism Analytics, WQL, and RaaS Extracts](https://kiweely.com/guides/workday-to-snowflake-databricks-data-cloud-prism-wql)
-   [Workday with MuleSoft, Boomi, and Workato: Choosing SOAP, REST, WQL, or RaaS and Governing Limits](https://kiweely.com/guides/workday-with-mulesoft-boomi-workato-integration-architecture)
-   [Workday 2027R1 Changes for Extend, Orchestrate, Studio, and APIs: Breaking Changes and Regression Checks](https://kiweely.com/guides/workday-2027r1-extend-orchestrate-studio-apis-breaking)
-   [Running WQL Queries in a Personal Workday Developer Tenant (Ready-to-Run GMS Examples)](https://kiweely.com/guides/workday-wql-queries-personal-developer-tenant-gms-examples)

### From the blog on WQL

[All posts](https://kiweely.com/blog)

-   [Workday 2027R1: The Five Changes Most Likely to Break Existing Reports, Security, and Integrations](https://kiweely.com/blog/workday-2027r1-five-changes-break-reports-security-apis)
-   [Workday 2027R1 for Extend and Orchestrate Teams: What to Retest Before Production Cutover](https://kiweely.com/blog/workday-2027r1-extend-orchestrate-what-to-retest)
-   [Build vs. Buy a Workday MCP Server: OAuth 2.1, SOAP, WQL, and Twice-Yearly Releases](https://kiweely.com/blog/build-vs-buy-workday-mcp-server-engineering-cost)

## Run WQL against your real tenant.

Kiweely Vine inspects your tenant's data sources and fields, runs the query under your Workday security, and verifies the rows returned.

[Get in touch](https://kiweely.com/vine#partners) [See Vine at work](https://kiweely.com/vine/work)

## Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.
