Untitled
Anonymous
plain_text
09/07/2022 11:20 AM
260 B
93
Indexable
WITH mc AS (SELECT CAST(DATE_TRUNC('month', created_at) as date) as dt, sum(costs) as sc
from tools_shop.costs
group by dt)
SELECT *, sc - LAG(sc, 1, NULL) OVER(order by dt) as sc2
FROM mcEditor is loading...