---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps]
keyword: [Extend, Workday Query Language, WQL]
nav: wcp_docs
parent_url: /wcp_docs/
title: SELECT
layout: subsection
---

<a id="d116e290"></a>
Returns field values from Workday data sources. Workday Query Language (WQL) requires this clause in all queries.

You can only access fields that:

-   Workday has authorized for use with the Workday Report Writer or default areas.
-   The current processing Workday account has permission to access.


## <a id="d116e298"></a>Syntax

```
SELECT field1 AS myAlias, function(field2), field1{relatedBusinessObjectField1}, ...fieldN
FROM dataSourceAlias
```

## <a id="d116e313"></a>Arguments

<table><thead><tr><th>Argument</th><th>Description</th></tr></thead><tbody><tr><td><code><i>field1</i>, <i>field2</i>, ...<i>fieldN</i></code></td><td>The WQL alias for the field you want to access. <p>If 2 or more fields have the same alias, WQL returns the first field defined in Workday.</p></td></tr><tr><td><code><i>myAlias</i></code></td><td>(Optional) Rename the column header in the response. <p>Example: <code>SELECT max(yearsOfService) as Seniority</code></p> <p>You can’t use a WQL keyword as a custom alias.</p> <p>WQL doesn’t support escape character syntax.</p> <p>WQL supports some special characters and spaces in single or double quotes. Examples:</p><ul><li>~
</li><li>@
</li><li>$
</li><li>*
</li><li>-
</li><li>_
</li><li>/
</li><li>?
</li><li>:
</li><li>;
</li></ul></td></tr><tr><td><code><i>function</i></code></td><td>(Optional) You can use these aggregation functions with fields: <ul><li><code>AVG(<i>field</i>)</code>
</li><li><code>COUNT()</code>
</li><li><code>COUNT(DISTINCT <i>field</i>)</code>
</li><li><code>MAX(<i>field</i>)</code>
</li><li><code>MIN(<i>field</i>)</code>
</li><li><code>SUM(<i>field</i>)</code>
</li></ul> <p><code>COUNT()</code> doesn't take any arguments.</p></td></tr><tr><td><code><i>relatedBusinessObjectfield1</i></code></td><td><p>The field of the related business object for which you want to filter results.</p></td></tr></tbody></table><br/>

## <a id="d116e516"></a>Aggregation Functions

<table><thead><tr><th>Aggregation Function</th><th>Description</th></tr></thead><tbody><tr><td><code>AVG(<i>field</i>)</code></td><td>Returns the average value of a numeric field.</td></tr><tr><td><code>COUNT()</code></td><td>Returns the number of instances matching the query criteria.</td></tr><tr><td><code>COUNT (DISTINCT <i>field</i>)</code></td><td>Returns the unique number of instances matching the query criteria. Use only on text and single instance fields.</td></tr><tr><td><code>MIN(<i>field</i>)</code></td><td>Returns the minimum value of a field.</td></tr><tr><td><code>MAX(<i>field</i>)</code></td><td>Returns the maximum value of a field.</td></tr><tr><td><code>SUM(<i>field</i>)</code></td><td>Returns the total sum of a numeric field.</td></tr></tbody></table><br/>

## <a id="d116e531"></a>Example

To return worker information from a data source:

```
SELECT worker, fullName, location FROM allWorkers
```

## <a id="d116e547"></a>Limitations

WQL doesn't support `SELECT *`.

