# ORDER BY

*noun*

say it: **“OR-der BY”** **/ˈɔːrdər baɪ/**

The part of a query that sorts the results by one or more columns.

## What is **ORDER BY** in a relational database?

**ORDER BY** — A clause that sorts a query result by one or more expressions.

```sql
SELECT order_id, ordered_on
FROM purchase_order
ORDER BY ordered_on DESC;
```

## In a sentence

- “I added **ORDER BY** UnitPrice DESC so the most expensive product comes first.”

Level: Novice · [More SQL terms at this level](https://www.ask-codey.com/glossary?category=sql&level=1)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/order-by
