Home > database >  Inquire how to put the two sum of value added
Inquire how to put the two sum of value added

Time:05-25

Is a list of different conditions found two SUM, now how to use a statement that the two SUM value summation?

SELECT sum (a.t otal_csm - a.f c_fy_csm - a.f eed_cpc_fy_csm - a.f eed_cpm_fy_csm - Amy polumbo pzx_jp_hy_csm - Amy polumbo pzx_jp_jj_csm - Amy polumbo pzx_core_other_csm)/1000 as CSM
The FROM apps. Apps_v_summary_di as a
WHERE the a. d. t & gt;='20200101' and a. d. t & lt;
='20200523'And a.c ust_id in (select f.i d from hn_fj_bn. BMD f)

SELECT sum (a.t otal_csm - a.f c_fy_csm - a.f eed_cpc_fy_csm - a.f eed_cpm_fy_csm - Amy polumbo pzx_jp_hy_csm - Amy polumbo pzx_jp_jj_csm - Amy polumbo pzx_core_other_csm)/1000 as CSM
The FROM apps. Apps_v_summary_di as a
WHERE the a. d. t & gt;='20200101' and a. d. t & lt;
='20200523'And a.c ust_id in (429130296429101, 82429545, 78)
  • Related