< Prev: WITH (Common Table Expressions)
Up: SQL Expressions
Next: IN >

SQL Expressions: ORDER BY

Fields can have the .Asc()/.Desc() methods called on them to simulate ASC/DESC. For postgres, the .NullsFirst()/.NullsLast() option is also available.
// ORDER BY tbl.column_1 ASC, tbl.column_2 DESC
OrderBy(tbl.COLUMN_1.Asc(), tbl.COLUMN_2.Desc())

// (postgres only)
// ORDER BY tbl.column_1 DESC NULLS FIRST, tbl.column2 NULLS LAST
OrderBy(tbl.COLUMN_1.Desc().NullsFirst(), tbl.COLUMN_2.NullsLast())
< Prev: WITH (Common Table Expressions)
Up: SQL Expressions
Next: IN >