Order the results
Order the query result by column
.
Parameters
- columnREQUIREDstring
The column to order by
- optionsOptionalobject
Named parameters
foreignTableREQUIREDstringSet this to order a foreign table by foreign columns
ascendingOptionalbooleanIf `true`, the result will be in ascending order
nullsFirstOptionalbooleanIf `true`, `null`s appear first. If `false`, `null`s appear last.
const { data, error } = await supabase
.from('countries')
.select('id', 'name')
.order('id', { ascending: false })