From b92234908c7d84c715e3c6f36244542a0db1cc61 Mon Sep 17 00:00:00 2001 From: Matthias Reusche Date: Tue, 17 Dec 2024 14:33:15 +0100 Subject: [PATCH] DB - sql correction --- Postgres-cds_hub/init/02_db_config_tools.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Postgres-cds_hub/init/02_db_config_tools.sql b/Postgres-cds_hub/init/02_db_config_tools.sql index d696e34a..be314421 100644 --- a/Postgres-cds_hub/init/02_db_config_tools.sql +++ b/Postgres-cds_hub/init/02_db_config_tools.sql @@ -2,9 +2,9 @@ ---------------------------------------------------- CREATE OR REPLACE VIEW db_config.v_cron_jobs AS SELECT command, count(1) anzahl -, (SELECT to_char(max(s.end_time),'YYYY-MM-DD HH24:MI:SS') FROM cron.job_run_details s WHEREs.command=m.command AND s.status='succeeded') last_succeeded_run -, (SELECT to_char(min(s.end_time),'YYYY-MM-DD HH24:MI:SS') FROM cron.job_run_details s WHEREs.command=m.command AND s.status='succeeded') first_succeeded_run -, (SELECT to_char(max(s.end_time),'YYYY-MM-DD HH24:MI:SS') FROM cron.job_run_details s WHEREs.command=m.command AND s.status!='succeeded') last_faild_run +, (SELECT to_char(max(s.end_time),'YYYY-MM-DD HH24:MI:SS') FROM cron.job_run_details s WHERE command=m.command AND s.status='succeeded') last_succeeded_run +, (SELECT to_char(min(s.end_time),'YYYY-MM-DD HH24:MI:SS') FROM cron.job_run_details s WHERE command=m.command AND s.status='succeeded') first_succeeded_run +, (SELECT to_char(max(s.end_time),'YYYY-MM-DD HH24:MI:SS') FROM cron.job_run_details s WHERE command=m.command AND s.status!='succeeded') last_faild_run FROM cron.job_run_details m group by command ORDER BY 3 desc; GRANT SELECT ON db_config.v_cron_jobs TO db_user;