Method: Sequel::SQL::Function#within_group

Defined in:
lib/sequel/sql.rb

#within_group(*expressions) ⇒ Object

Return a new function that uses WITHIN GROUP ordered by the given expression, useful for ordered-set and hypothetical-set aggregate functions:

Sequel.function(:rank, :a).within_group(:b, :c)
# rank(a) WITHIN GROUP (ORDER BY b, c)


1475
1476
1477
# File 'lib/sequel/sql.rb', line 1475

def within_group(*expressions)
  with_opts(:within_group=>expressions.freeze)
end