PL/SQL: ORA-00934: 此处不允许使用分组函数
SELECT COUNT(C_JTH) into a1_LI_JDHS,
--select nvl(sum(case a.comm when 0 then 1 else 0 end ),0) from scott.emp a;
nvl(sum(case jt.I_ZT when 0 then 1 else 0 end), 0) into a1_LI_ZXHS,
NVL(sum(
CASE
WHEN YEAR(jt.DT_JDRQ)=YEAR(sysdate)
THEN 1
ELSE 0
END),0) into a1_LI_YJDHS
NVL(sum(
CASE
WHEN YEAR(jt.DT_JDRQ)=YEAR(sysdate) AND I_ZT=0
THEN 1
ELSE 0 END),0) into a1_LI_YZXHS
FROM SQGL_JTJBXX jt,V_SQGL_JGXX
WHERE V_SQGL_JGXX.V_PATH LIKE '%'+a1_DEP_ID+'%'and SQGL_JTJBXX.Dep_ID = V_SQGL_JGXX.Dep_ID ;
--select nvl(sum(case a.comm when 0 then 1 else 0 end ),0) from scott.emp a;
nvl(sum(case jt.I_ZT when 0 then 1 else 0 end), 0) into a1_LI_ZXHS,
NVL(sum(
CASE
WHEN YEAR(jt.DT_JDRQ)=YEAR(sysdate)
THEN 1
ELSE 0
END),0) into a1_LI_YJDHS
NVL(sum(
CASE
WHEN YEAR(jt.DT_JDRQ)=YEAR(sysdate) AND I_ZT=0
THEN 1
ELSE 0 END),0) into a1_LI_YZXHS
FROM SQGL_JTJBXX jt,V_SQGL_JGXX
WHERE V_SQGL_JGXX.V_PATH LIKE '%'+a1_DEP_ID+'%'and SQGL_JTJBXX.Dep_ID = V_SQGL_JGXX.Dep_ID ;
作者: 770937280 发布时间: 2011-12-03
这个sql语句没有错呀???
作者: 770937280 发布时间: 2011-12-03