Is there a way in dbplyr to generate SQL of the form
SELECT
SUM(`col1`) OVER `wnd` AS `s1`,
SUM(`col2`) OVER `wnd` AS `s2`,
SUM(`col3`) OVER `wnd` AS `s3`
FROM `my_table`
WINDOW `wnd` AS (PARTITION BY `col4` ORDER BY `col5`)
?
(i.e., avoid spelling out the same window-spec repeatedly within the same query, and refer to it by a name instead) ?
The benefit of having this is the generated query would be shorter and easier to debug (as it's immediately clear that the same window spec is applied to multiple aggregations).
Is there a way in
dbplyrto generate SQL of the form?
(i.e., avoid spelling out the same window-spec repeatedly within the same query, and refer to it by a name instead) ?
The benefit of having this is the generated query would be shorter and easier to debug (as it's immediately clear that the same window spec is applied to multiple aggregations).