---
id: order
title: "order()"
slug: order
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
---
import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';
Orders the result with the specified `column`.
```js
const { data, error } = await supabase
.from('cities')
.select('name', 'country_id')
.order('id', { ascending: false })
```
## Parameters
-
column
required
object
The column to order on.
-
__namedParameters
required
object
No description provided.
Properties
-
nullsFirst
required
boolean
If `true`, `null`s appear first.
-
foreignTable
required
undefined | string
The foreign table to use (if `column` is a foreign column).
-
ascending
required
boolean
If `true`, the result will be in ascending order.
## Examples
### With `select()`
```js
const { data, error } = await supabase
.from('cities')
.select('name', 'country_id')
.order('id', { ascending: false })
```
### With embedded resources
```js
const { data, error } = await supabase
.from('countries')
.select('name, cities(name)')
.eq('name', 'United States')
.order('name', {foreignTable: 'cities'})
```