module Sequel::SQL::AliasMethods

  1. lib/sequel/sql.rb

Includes an as method that creates an SQL alias.

Methods

Public Instance

  1. as

Public Instance methods

as (aliaz, columns=nil)

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")
[show source]
    # File lib/sequel/sql.rb
260 def as(aliaz, columns=nil)
261   AliasedExpression.new(self, aliaz, columns)
262 end