[
https://issues.apache.org/jira/browse/CALCITE-5268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17688835#comment-17688835
]
Julian Hyde commented on CALCITE-5268:
--------------------------------------
[~bchong95], Thanks for the revisions. I rebased onto main and made a few
fix-ups in
[julianhyde/5268-qualify|https://github.com/julianhyde/calcite/tree/5268-qualify].
If they look OK to you, I'll merge.
> Add QUALIFY clause
> ------------------
>
> Key: CALCITE-5268
> URL: https://issues.apache.org/jira/browse/CALCITE-5268
> Project: Calcite
> Issue Type: New Feature
> Reporter: Brandon Chong
> Assignee: Brandon Chong
> Priority: Major
> Labels: pull-request-available
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> {{QUALIFY}} is to Window functions what {{HAVING}} is to {{GROUP BY}}.
> For example:
> {code}
> SELECT a, b, c, ROW_NUMBER() OVER (PARTITION BY b ORDER BY c) as row_num
> FROM t1
> QUALIFY row_num = 1
> {code}
> Is the same as:
> {code}
> SELECT *
> FROM (
> SELECT a, b, c, ROW_NUMBER() OVER (PARTITION BY b ORDER BY c) as row_num
> FROM t1)
> WHERE row_num = 1
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)