Commit 404e8a07 authored by Leo Gordon's avatar Leo Gordon
Browse files

show count to be 0 for analyses which have no jobs

parent f7523be1
......@@ -14,7 +14,11 @@
# select * from progress where retry_count>1; # only show jobs that have been tried more than once
CREATE OR REPLACE VIEW progress AS
SELECT CONCAT(a.logic_name,'(',a.analysis_id,')') analysis_name_and_id, j.status, j.retry_count, count(*) cnt, job_id example_job_id
SELECT CONCAT(a.logic_name,'(',a.analysis_id,')') analysis_name_and_id,
j.status,
j.retry_count,
CASE WHEN j.status IS NULL THEN 0 ELSE count(*) END cnt,
job_id example_job_id
FROM analysis a LEFT JOIN job j USING (analysis_id)
GROUP BY a.analysis_id, j.status, j.retry_count
ORDER BY a.analysis_id, j.status;
......
......@@ -14,7 +14,11 @@
-- select * from progress where retry_count>1; # only show jobs that have been tried more than once
CREATE VIEW IF NOT EXISTS progress AS
SELECT a.logic_name || '(' || a.analysis_id || ')' analysis_name_and_id, j.status, j.retry_count, count(*) cnt, job_id example_job_id
SELECT a.logic_name || '(' || a.analysis_id || ')' analysis_name_and_id,
j.status,
j.retry_count,
CASE WHEN j.status IS NULL THEN 0 ELSE count(*) END cnt,
job_id example_job_id
FROM analysis a LEFT JOIN job j USING (analysis_id)
GROUP BY a.analysis_id, j.status, j.retry_count
ORDER BY a.analysis_id, j.status;
......
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