Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Usage Stats

This queries the stats data that is used to populated the graphs on the initial staff dashboard page to find the number of active users over total users for each group for a month. It is restricted to Unit type groups.

SELECT
  A.code,
  A.group_name,
  B.value,
  C.value
FROM
  pv_group A
LEFT JOIN pv_group_statistic B ON A.id = B.group_id AND B.type_id = 52 AND B.start_date = '2021-12-01'
LEFT JOIN pv_group_statistic C ON A.id = C.group_id AND C.type_id = 53 AND C.start_date = '2021-12-01'
WHERE
  A.type_id = 1;

  • No labels