Method: Sequel::Dataset#group_append

Defined in:
lib/sequel/dataset/query.rb

#group_append(*columns, &block) ⇒ Object

Returns a copy of the dataset with the given columns added to the list of existing columns to group on. If no existing columns are present this method simply sets the columns as the initial ones to group on.

DB[:items].group_append(:b) # SELECT * FROM items GROUP BY b
DB[:items].group(:a).group_append(:b) # SELECT * FROM items GROUP BY a, b


406
407
408
409
# File 'lib/sequel/dataset/query.rb', line 406

def group_append(*columns, &block)
  columns = @opts[:group] + columns if @opts[:group]
  group(*columns, &block)
end