---
title: "sort(on:_:order:)"
framework: tabulardata
role: symbol
role_heading: Instance Method
path: "tabulardata/dataframe/sort(on:_:order:)-8wrkl"
---

# sort(on:_:order:)

Arranges the rows of a data frame according to two columns that you select by their column identifiers.

## Declaration

```swift
mutating func sort<T0, T1>(on columnID0: ColumnID<T0>, _ columnID1: ColumnID<T1>, order: Order = .ascending) where T0 : Comparable, T1 : Comparable
```

## Parameters

- `columnID0`: The identifier of a column.
- `columnID1`: The identifier of another column.
- `order`: A sorting order.

## Discussion

Discussion note: Elements with a value of nil are less than all non-nil values.

## See Also

### Sorting a Data Frame

- [sort(on:order:)](tabulardata/dataframe/sort(on:order:)-4vns7.md)
- [sort(on:_:order:)](tabulardata/dataframe/sort(on:_:order:)-78avw.md)
- [sort(on:_:by:)](tabulardata/dataframe/sort(on:_:by:).md)
- [sort(on:by:)](tabulardata/dataframe/sort(on:by:).md)
- [sort(on:order:)](tabulardata/dataframe/sort(on:order:)-5ep7w.md)
- [sort(on:_:_:order:)](tabulardata/dataframe/sort(on:_:_:order:).md)
