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)
1446 1447 1448 1449 1450 |
# File 'lib/sequel/sql.rb', line 1446 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 |