Order By
Order by
const { data, error } = db
.selectFrom([
{ table: 'table_name', columns: ['first_name'] }
])
.orderBy('first_name') // Orders it by the first_name column
.query()Ascending order
const { data, error } = db
.selectFrom([
{ table: 'table_name', columns: ['first_name'] }
])
.orderBy(ascending('first_name')) // Returns from A-Z
.query()Descending order
Last updated