Module: Sequel::SQL::AliasMethods

Overview

Includes an as method that creates an SQL alias.

Instance Method Summary collapse

Instance Method Details

#as(aliaz, columns = nil) ⇒ Object

Create an SQL alias (AliasedExpression) of the receiving column or expression to the given alias.

Sequel.function(:func).as(:alias) # func() AS "alias"
Sequel.function(:func).as(:alias, [:col_alias1, :col_alias2]) # func() AS "alias"("col_alias1", "col_alias2")


268
269
270
# File 'lib/sequel/sql.rb', line 268

def as(aliaz, columns=nil)
  AliasedExpression.new(self, aliaz, columns)
end