Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTILE is scary #46763

Closed
alexey-milovidov opened this issue Feb 23, 2023 · 1 comment · Fixed by #49093
Closed

NTILE is scary #46763

alexey-milovidov opened this issue Feb 23, 2023 · 1 comment · Fixed by #49093
Assignees

Comments

@alexey-milovidov
Copy link
Member

Describe the issue

I can write this:

ntile(4) OVER (ORDER BY price DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS quartile

But this does not work:

ntile(4) OVER (ORDER BY price DESC) AS quartile

While it works in MS SQL Server: https://learn.microsoft.com/en-us/sql/t-sql/functions/ntile-transact-sql?view=sql-server-ver16

@vdimir
Copy link
Member

vdimir commented Feb 23, 2023

Since ntile supports only a particular frame type, we can use it without explicit specification and forbid specifying any other ones.

In MS SQL the function 'ntile' may not have any window frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants