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")


255
256
257
# File 'lib/sequel/sql.rb', line 255

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