SQLite.swift icon indicating copy to clipboard operation
SQLite.swift copied to clipboard

Implements built-in window functions

Open geoffmacd opened this issue 1 year ago • 0 comments

Adds window functions to Sqlite.swift, see https://www.sqlite.org/windowfunctions.html#built_in_window_functions. The OVER cause was problematic in the current structure of the code, so for now, only OVER (ORDER BY {expression}) is supported but that is most of the use cases. The ORDER BY used here is not the same as the func order() in QueryType and cannot used like this.

  • row_number()
  • rank()
  • dense_rank()
  • percent_rank()
  • cume_dist()
  • ntile(N)
  • lag(expr, offset, default)
  • lead(expr, offset, default)
  • first_value(expr)
  • last_value(expr)
  • nth_value(expr, N)

geoffmacd avatar Nov 19 '23 02:11 geoffmacd