---
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: ORDER BY
layout: subsection
---

<a id="d56e263"></a>
Sorts the results in ascending or descending order, based on 1 or more fields. WQL sorts data alphabetically, not logically. When you don't include an ORDER BY clause, WQL sorts using a default internal record ID.

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

```
ORDER BY
field1 ASC, field2 DESC
```

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

<table><thead><tr><th>Argument</th><th>Description</th></tr></thead><tbody><tr><td><code><code><i>field1</i>, <i>field2</i>, ...<i>fieldN</i></code></code></td><td>The aliases for the fields by which you want to sort your results.</td></tr><tr><td><code>ASC</code> <p><code>DESC</code></p></td><td><p>Sort results in ascending or descending alphabetical order.</p> <p>When you convert a report with no sort field to WQL, the conversion doesn't insert an ORDER BYclause. WQL sorts the query using the default internal record ID.</p></td></tr></tbody></table><br/>

