unload to "/u/catcom/tx/egsum_ccat_2018.csv" delimiter ","
select callcatdesc, callcategory.callcategory, inouttype,
       sum(callcount) count, sum(callcost) cost
from trk_extsum, calltypedef, callcategory
where trk_extsum.calltype = calltypedef.calltypecode
  and calltypedef.callcategory = callcategory.callcategory
--#  and trk_extsum.inouttype matches "[EP]"
  and sumdate between "01/01/2018" and "31/12/2018"
group BY 1, 2, 3
order BY 1, 2, 3
