Hello,
Is this a legal query? When I execute it postgres dumps core. I know the
types match in each select.
select route,
sum(date_part('epoch',age(termdate,startdate))) as inuse,
date_part('year',startdate) as year,
date_part('month',startdate) as month,
date_part('day',startdate) as day,
date_part('hour',startdate) as hour,
date_part('minute',startdate) as minute,
date_part('second',startdate) as second
from incomingcalls
where startdate between '4/16/99' and '4/16/99/ 23:59:59'
group by route,year,month,day,hour,minute,second
UNION ALL
select route,
sum(date_part('epoch',age(termdate,startdate))) as inuse,
date_part('year',startdate) as year,
date_part('month',startdate) as month,
date_part('day',startdate) as day,
date_part('hour',startdate) as hour,
date_part('minute',startdate) as minute,
date_part('second',startdate) as second
from outgoingcalls
where startdate between '4/16/99' and '4/16/99/ 23:59:59'
group by route,year,month,day,hour,minute,second
Any help appreciated.
Bill Carlson | Opinions expressed are my own
KINZE Manufacturing, Inc. | not my employer's.