摘要:
1.为了使用ORG_ID,由于OCRM_F_MM_MKT_PLAN a 没有ORG_ID,但是OCRM_F_MM_EXECUTE_INST_DESC d 表里面有,可以使a表连接b表,创建临时表t。select t.PLAN_S AS MARKET_PLAN_COUNT,t.SUM_PLAN AS PLAN_ACC_COUNT from (select count(a.MKT_PLAN_STAT) as PLAN_S,sum(case when a.MKT_PLAN_STAT='3' then 1 else 0 end) as SUM_PLAN from OCRM_F_MM_M 阅读全文