Method: Sequel::SQL::Function#over

Defined in:
lib/sequel/sql.rb

#over(window = OPTS) ⇒ Object

Return a new function with an OVER clause (making it a window function). See Window for the list of options over can receive.

Sequel.function(:row_number).over(:partition=>:col) # row_number() OVER (PARTITION BY col)

Raises:



1431
1432
1433
1434
1435
# File 'lib/sequel/sql.rb', line 1431

def over(window=OPTS)
  raise Error, "function already has a window applied to it" if opts[:over]
  window = Window.new(window) unless window.is_a?(Window)
  with_opts(:over=>window)
end