select a.Account_period,a.Emp_no,a.Area_no,a.Region_no,a.Oper_type,a.Sale_type,a.Dinner_no, sum(a.This_Fee) This_Fee,sum(a.Last_Fee) Last_Fee, sum((sum(a.This_Fee)-sum(a.Last_Fee))/sum(a.Last_Fee)*100 )as breadth from trm_emp_fee a,tei_employee_info b where a.emp_no=b.emp_no and a.account_period = '200502' and b.data_power like 'CQ__________________' group by a.Account_period,a.Emp_no,a.Area_no,a.Region_no,a.Oper_type,a.Sale_type,a.Dinner_no order by a.emp_no沒有調試不知道對不對
sum(a.This_Fee) This_Fee,sum(a.Last_Fee) Last_Fee,
sum((sum(a.This_Fee)-sum(a.Last_Fee))/sum(a.Last_Fee)*100 )as breadth
from trm_emp_fee a,tei_employee_info b
where a.emp_no=b.emp_no and a.account_period = '200502'
and b.data_power like 'CQ__________________'
group by a.Account_period,a.Emp_no,a.Area_no,a.Region_no,a.Oper_type,a.Sale_type,a.Dinner_no
order by a.emp_no沒有調試不知道對不對