Update umami sql queries

This commit is contained in:
2026-05-26 16:51:46 +02:00
parent f0eb28a627
commit cda142b3d1
4 changed files with 24 additions and 9 deletions
@@ -23,8 +23,8 @@ SELECT
*
FROM
crosstab(
'SELECT "group", sim_type, count::text FROM weekly_sim_submit_count_v2 ORDER BY 1, 2',
'SELECT DISTINCT sim_type FROM weekly_sim_submit_count_v2 ORDER BY 1'
'SELECT "group", sim_type, count::text FROM weekly_sim_submit_count WHERE sim_type <> ''lice-network'' AND sim_type <> ''lice-delousing'' ORDER BY 1, 2',
'SELECT DISTINCT sim_type FROM weekly_sim_submit_count WHERE sim_type <> ''lice-network'' AND sim_type <> ''lice-delousing'' ORDER BY 1'
) AS ct (
group_name text,
lice bigint,
@@ -33,3 +33,9 @@ FROM
virus bigint,
watercontact bigint
)
WHERE
(lice + sedimentation + transport + virus + watercontact) <> 0
AND "group" <> '@oceanbox.io'
ORDER BY
(lice + sedimentation + transport + virus + watercontact) DESC
;