请指出这段代码的错误:select emp_cd -- 顾问编码 ,data_dt -- 日期 ,tch_amt -- 教学品金额 from ( select shop_cd ,emp_cd ,replace(to_date(pay_tm),'-','') as data_dt ,sum(prod_pay_amt) as tch_amt from dw.d_ka_ss_tpsc_order_product_dtl op -- 门店订单产品明细表 inner join dw.dim_ka_pub_product_master_data pmd -- 产品主数据表 on op.product_cd = pmd.product_cd where pmd.sec_tch_typ='教学品' union all -- 后面这部分也是没看懂 select shop_cd ,emp_cd ,data_dt sum(correct_comb_amt) as tch_amt from dw.s_ka_ss_shop_emp_prod_d_mild pdm inner join dw.dim_ka_pub_product_master_data pmd on pdm.product_cd = pmd.product_cd where pmd.sec_tch_typ='教学品' ) t group by emp_cd ,data_dt
时间: 2023-03-25 09:02:34 浏览: 178
VHDL.rar_ 相位测量_emp7128_phase-measuring _相位测量
这段代码的错误是在第二个子查询中缺少一个逗号,应该是:select shop_cd ,emp_cd ,data_dt, sum(correct_comb_amt) as tch_amt from dw.s_ka_ss_shop_emp_prod_d_mild pdm inner join dw.dim_ka_pub_product_master_data pmd on pdm.product_cd = pmd.product_cd where pmd.sec_tch_typ='教学品'。
阅读全文