You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, folks. I want support for CTEs (common table expressions) as a new feature of PonyORM.
Motivation
Some queries require using CTEs. For instance, a query using window functions as a filter condition needs CTE like this:
WITH q(`id`, `sum_price`) AS (
SELECT`id`, sum(`price`) OVER (order by`last_updated`desc) AS`count`FROM`items`
)
SELECT`id`FROM`q`WHERE`sum_price`<20;
As a limitation over window functions of standard SQL, it never allows using window functions in WHERE/HAVING clause. Because of this reason, CTE is inevitable for this query.
The text was updated successfully, but these errors were encountered:
Hi, folks. I want support for CTEs (common table expressions) as a new feature of PonyORM.
Motivation
Some queries require using CTEs. For instance, a query using window functions as a filter condition needs CTE like this:
As a limitation over window functions of standard SQL, it never allows using window functions in WHERE/HAVING clause. Because of this reason, CTE is inevitable for this query.
The text was updated successfully, but these errors were encountered: