added division column to the event_counts table in lifecycle.sql.

master
dtookey 4 years ago
parent a551f9321c
commit 9f300305c5

@ -1,6 +1,10 @@
DROP TABLE IF EXISTS event_counts;
CREATE TABLE event_counts AS
SELECT DATE(timestamp) as event_date,
(SELECT CONCAT(SUBSTRING(all_projects.refnum, 1, 3), ' - ', all_projects.proj_type)) as division,
if(substring(new_value, 1, 1) = '+', 1, -1) as event_count,
SUBSTRING(`new_value` FROM 2) as flag
FROM project_lifecycle
INNER JOIN all_projects on project_lifecycle.project_number = all_projects.refnum
WHERE changed_column = 'status';
Loading…
Cancel
Save