select to_char(calldate,'Day') as Day, date_trunc(calldate) as transdate,
Onnet' as destination,ceil(sum(callduration::integer/60) )as total_minutes,round(sum(alltaxcost::integer) ,2)as revenue
from cdr_data
where callclass ='008' and callsubclass='001'
and callduration::integer >0
and regexp_like(identifiant,'^73')
and bundleunits = 'Money'
and inserviceresultindicator in (0,5)
and regexp_like(regexp_replace(callednumber,'^256','') ,'^73')
group by to_char(calldate,'Day') ,trunc(calldate),'Onnet' order by 2
我得到的错误是:
Err] ERROR: function date_trunc(timestamp without time zone) does not exist
LINE 4: select to_char(calldate,'Day') as Day, date_trunc(calldate)...
我做错了什么或者这个错误的解决方案是什么。
答案 0 :(得分:10)