有人可以帮我解决有关数据显示的问题吗?
参考上面的屏幕截图,应该显示SCREENSHOT B而不是SCREENSHOT A.这是我的查询:
select
c.department_description,
e.cost_center_code,
sum(a.cdr_charge_amount)as total
from cdr_employees a
join employees b on a.employee_id = b.employee_id
join departments c on b.department_id = c.department_id
join employee_cost_centers d on b.employee_id = d.employee_id
join cost_centers e on d.cost_center_id = e.cost_center_id
where a.cdr_datetime > '2016-01-01 00:00:00'
group by c.department_description, e.cost_center_code
order by c.department_description
我该怎么办?我应该使用什么查询来显示SCREENSHOT B等数据?
提前致谢。