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 Sequel::SQL::Window for the list of options over can receive.

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

Raises:



1440
1441
1442
1443
1444
# File 'lib/sequel/sql.rb', line 1440

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