mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 18:34:26 +08:00
43 lines
778 B
Plaintext
43 lines
778 B
Plaintext
---
|
|
id: order
|
|
title: 'order()'
|
|
slug: /order
|
|
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_dart_v1_legacy.yml
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs'
|
|
import TabItem from '@theme/TabItem'
|
|
|
|
Orders the result with the specified column.
|
|
|
|
```dart
|
|
final res = await supabase
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.order('id', ascending: false )
|
|
.execute();
|
|
```
|
|
|
|
## Examples
|
|
|
|
### With `select()`
|
|
|
|
```dart
|
|
final res = await supabase
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.order('id', ascending: false )
|
|
.execute();
|
|
```
|
|
|
|
### With embedded resources
|
|
|
|
```dart
|
|
final res = await supabase
|
|
.from('countries')
|
|
.select('name, cities(name)')
|
|
.eq('name', 'United States')
|
|
.order('name', foreignTable: 'cities')
|
|
.execute();
|
|
```
|