Query to get complete SLA details. (PGSQL)

Query to get complete SLA details. (PGSQL)

Tested in build PGSQL (14300) 

To get the complete list of SLA  configured in the application. 

PGSQL:

SELECT sdo.name "Site Name" ,
       sla.slaname "SLA",
       MAX(sla.duebydays) "SLA Days",
       MAX(sla.duebyhours) "SLA Hours",
       MAX(sla.duebyminutes) "SLA Minutes" ,
       MAX(sla.fr_duebydays) "First Response Days",
       MAX(sla.fr_duebyhours) "First Response Hours",
       MAX(sla.fr_duebyminutes) "First Response Minutes",
       array_to_string(array_agg(au.first_name), ' ') "Escalate to" FROM sladefinition sla
LEFT JOIN sitedefinition sdf ON sla.siteid=sdf.siteid
LEFT JOIN sdorganization sdo ON sdf.siteid=sdo.org_id
LEFT JOIN timezonedefinition tz ON sdf.timezoneid=tz.timezoneid
LEFT JOIN slaescalation es ON sla.slaid=es.slaid
LEFT JOIN escalateton eton ON es.escalatetoid=eton.escalatetoid
LEFT JOIN aaauser au ON au.user_id=eton.userid
GROUP BY sdo.name,
         sla.slaname
ORDER BY 2


Sample Output:


                  New to ADSelfService Plus?