SELECT wo.WORKORDERID AS "Request ID", aau.FIRST_NAME AS "Requester", sdo.NAME AS "Site", ti.FIRST_NAME AS "Request Technician" ,au1.FIRST_NAME AS "Worklog Technician", TO_CHAR(((sum(ct.TIMESPENT))/1000 || ' second')::interval, 'HH24:MI:SS') AS "Time Spent", ct.TOTAL_CHARGE AS "Total Cost", LONGTODATE(ct.CREATEDTIME) AS "Created Time", LONGTODATE(ct.TS_STARTTIME) AS "Start Time", LONGTODATE(ct.TS_ENDTIME) AS "End Time", wtd.NAME AS "Work Log Type", ct.SHORT_DESCRIPTION AS "Description", ac.CONTRACTNAME AS "Contract Name",sdo1.NAME AS "Account Name" FROM WorkOrder wo LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID LEFT JOIN SDUser td ON wos.OWNERID=td.USERID LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID LEFT JOIN SiteDefinition siteDef ON wo.SITEID=siteDef.SITEID LEFT JOIN SDOrganization sdo ON siteDef.SITEID=sdo.ORG_ID LEFT JOIN WorkOrderToCharge wotoc on wotoc.WORKORDERID=wo.WORKORDERID LEFT JOIN ChargesTable ct ON ct.CHARGEID=wotoc.CHARGEID LEFT JOIN AaaUser au1 ON ct.TECHNICIANID=au1.USER_ID LEFT JOIN WorkLogTypeDefinition wtd ON ct.WORKLOGTYPEID=wtd.WORKLOGTYPEID LEFT JOIN WorklogtoContract wltc ON ct.CHARGEID=wltc.CHARGEID LEFT JOIN AccountContract ac ON wltc.CONTRACTID=ac.CONTRACTID LEFT JOIN WorkOrderAccountMapping woac ON woac.WORKORDERID=wo.WORKORDERID LEFT JOIN SDOrganization sdo1 ON woac.ACCOUNTID=sdo1.ORG_ID WHERE (wo.ISPARENT='1') group by wo.workorderid,aau.first_name,sdo.NAME,ti.FIRST_NAME,au1.FIRST_NAME,ct.TOTAL_CHARGE,ct.CREATEDTIME,ct.TS_STARTTIME,ct.TS_ENDTIME,wtd.NAME,ct.SHORT_DESCRIPTION,ac.CONTRACTNAME,sdo1.NAME
Result: