forecast_api/offline/list_changes_table.sql

20 lines
407 B
MySQL
Raw Normal View History

SELECT
iterdef->>'user' "user",
2019-04-03 09:56:01 -04:00
quota_rep_descr,
(iterdef->>'stamp')::timestamptz "stamp",
2019-03-27 13:24:49 -04:00
iterdef->>'type' "type",
round(SUM(fb_val_loc * r_rate)::numeric,2) sales,
jsonb_pretty(iterdef) def
FROM
rlarp.osm_fcpool
WHERE
iterdef IS NOT NULL
GROUP BY
iterdef->>'user',
2019-04-03 09:56:01 -04:00
quota_rep_descr,
iterdef->>'stamp',
2019-03-27 13:24:49 -04:00
iterdef->>'type',
iterdef
ORDER BY
"stamp" DESC