查询:
select acc.cust_no, surrogateTable.category as categoryCall, count(acc.calling_no) as totalCalls
from (select 'Completed' as category union all select 'Unanswered' as category) as surrogateTable
left join acc on surrogateTable.category = 'Completed'
where acc.method = 'INVITE' AND acc.sip_code = '200' and
(acc.cust_no = 'BIS00031' or acc.cust_no = 'BIS00031')
UNION
select missed_call.cust_no, surrogateTable.category as categoryCall, count(missed_call.calling_no) as totalCalls
from (select 'Completed' as category union all select 'Unanswered' as category) as surrogateTable
left join missed_call on surrogateTable.category = 'Unanswered'
where missed_call.method = 'INVITE' AND missed_call.sip_code = '487' and
(missed_call.cust_no = 'BIS00031' or missed_call.cust_no = 'BIS00031')
order by categoryCall ASC
查询结果:
报告设计:
报告结果:
谁能告诉我为什么我没有categoryCall
在 Crystal Report 结果中得到结果?(应该在报告的“类别”栏中显示“已完成”和“未答复”,根本不显示)