SELECT M.JCDATE,D.Totalweight,D.ENDWEIGHT,D.TYPE,P.DSCR AS P_NAME,D.REMARK,(select sum(T.Totalweight) AS SW FROM JC_DETAILDATA T LEFT JOIN JC_MAINDATA A ON T.MAINID=A.ID
WHERE T.PRDCT_NO=D.PRDCT_NO AND A.JCDATE BETWEEN (trunc(1, 'd') + 1) AND (trunc(1, 'd') + 7)) as WEEKWEIGHT,(select sum(T.Totalweight) AS SW FROM JC_DETAILDATA T LEFT JOIN JC_MAINDATA A ON T.MAINID=A.ID
WHERE T.PRDCT_NO=D.PRDCT_NO AND A.JCDATE BETWEEN trunc(add_months(last_day(1), -1) + 1) AND last_day(1)) AS TWEIGHT FROM JC_DETAILDATA D
LEFT JOIN JC_MAINDATA M ON M.ID=D.MAINID
LEFT JOIN IP_PRDCT P ON D.PRDCT_NO=P.PRDCT_NAME
WHERE M.JCDATE=1 AND M.ORG_CODE='CJSGS_SCB'
--------------------------这是我写的SQL查询,在PL/SQL上执行是没有问题的,但是我放到报表数据源里面,就报错,如下图:
报错可能是红色字体部分,但是SQL是合法的。
file:///C:\Users\13146\Documents\Tencent Files\13146015\Image\C2C\{Q(FRDPM$WF)P4A9GZV~6_4.pngfile:///C:\Users\13146\Documents\Tencent Files\13146015\Image\C2C\{Q(FRDPM$WF)P4A9GZV~6_4.png
file:///C:\Users\13146\Documents\Tencent Files\13146015\Image\C2C\{Q(FRDPM$WF)P4A9GZV~6_4.png
|