获取错误
查看与您的MySQL服务器版本相对应的手册, 在'(PARTITION BY th_class_4,th_class_3, th_class_2,th_class_1),t2.QTY AS QTY f'在第2行
select t1.PROD_NM as PROD_NM,t1.TherapeuticClass as TherapeuticClass,
t1.MFG as MFG,round(t2.TOTAL,2),SUM(t2.TOTAL)OVER(PARTITION BY th_class_4, th_class_3, th_class_2, th_class_1 )
,t2.QTY AS QTY from
(select PROD_NM,concat(TH_CLASS_1,",",TH_CLASS_2,",",TH_CLASS_3,",",TH_CLASS_4)
as TherapeuticClass,MFG from RETAIL_STORE_PROD
where TH_CLASS_1!='NULL' and TH_CLASS_2!='NULL' and TH_CLASS_3!='NULL'
and TH_CLASS_4!='NULL')t1
join
(select PROD_NM,sum(TOTAL) AS TOTAL,sum(QTY) AS QTY from RETAIL_STR_SALES_DETAIL
group by PROD_NM)t2 on t1.PROD_NM=t2.PROD_NM