How to convert CTE to normal query? – PHP Versions
How can I convert this to normal query? WITH cte AS ( SELECT agentID, SUM(bonus > 0) OVER (PARTITION BY agentID ORDER BY `year` * 12 + `month` RANGE BETWEEN 2 PRECEDING AND CURRENT ROW) flag FROM test ) SELECT…