Skip to content

window functions: document "workaround" to ORDER BY frame caveat #6152

Open
@RaduBerinde

Description

@RaduBerinde

Radu Berinde (RaduBerinde) commented:

The window functions documentation has the caveat about how ORDER BY changes the default frame: https://www.cockroachlabs.com/docs/v19.2/window-functions.html#caveats

What is missing from this is a workaround - what do I need to do to keep the frame as it would be if there was no ORDER BY? (this came up with a user who wanted the ORDER BY just to control the order of elements in a json_agg).

I believe the correct thing to do would be to add RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING but I might be wrong - @justinj or @yuzefovich should confirm.

Jira Issue: DOC-396

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions