module Sequel::SQL::OrderMethods

  1. lib/sequel/sql.rb
Parent: SQL

Methods that create OrderedExpressions, used for sorting by columns or more complex expressions.

Methods

Public Instance

  1. asc
  2. desc

Public Instance methods

asc (opts=OPTS)

Mark the receiving SQL column as sorting in an ascending fashion (generally a no-op). Options:

:nulls

Set to :first to use NULLS FIRST (so NULL values are ordered before other values), or :last to use NULLS LAST (so NULL values are ordered after other values).

[show source]
# File lib/sequel/sql.rb, line 830
def asc(opts=OPTS)
  OrderedExpression.new(self, false, opts)
end
desc (opts=OPTS)

Mark the receiving SQL column as sorting in a descending fashion. Options:

:nulls

Set to :first to use NULLS FIRST (so NULL values are ordered before other values), or :last to use NULLS LAST (so NULL values are ordered after other values).

[show source]
# File lib/sequel/sql.rb, line 840
def desc(opts=OPTS)
  OrderedExpression.new(self, true, opts)
end