Commit 1a806995 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[METRICS] with increase part

parent 2b1f0858
Pipeline #5679 passed with stages
in 107 minutes and 59 seconds
select count(*) from nodes n where n.typename = 30;
WITH total AS (SELECT * from nodes n where n.typename = 30)
, sum AS (SELECT count(*) from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
FROM sum
select count(*) from nodes n where n.typename = 9;
WITH total AS (SELECT * from nodes n where n.typename = 9)
, sum AS (SELECT count(*) from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
FROM sum
select count(*) from nodes n where n.typename = 90;
WITH total AS (SELECT * from nodes n where n.typename = 90)
, sum AS (SELECT count(*) from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
FROM sum
select count(*) from nodes n where n.typename = 210;
WITH total AS (SELECT * from nodes n where n.typename = 210)
, sum AS (SELECT count(*) from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
FROM sum
select count(*) from auth_user;
WITH total AS (SELECT * from auth_user as A)
, sum AS (SELECT count(*) from total)
, increase AS (SELECT count(*) from total as t WHERE t.date_joined >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
FROM sum
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment