sql语句执行不出来,为什么?

select '大客户' as bs,
sum(ZZL) as ZZL,
sum(FYJE) as ZJE,
sum(CS) as ZCS
from TB_HP_JBXX
where
zfbj = '0'
and rkdate >=
to_date('2017/11/26 18:00:00', 'yyyy-mm-dd hh24:mi:ss')
and rkdate <=
to_date('2017/11/27 18:00:00', 'yyyy-mm-dd hh24:mi:ss')
and FZLJM = '02'
and
fhrmc in (select fhrmc
from (select fhrmc, sum(zzl) zzl
from TB_HP_JBXX
where zfbj = '0'
and fzmc in
(select DEPTNAME
from TB_AUT_DEPARTMENT_HY
where parentcode = 'DEPT000031')
and rkdate >=
to_date('2016/1/1 18:00:00',
'yyyy-mm-dd hh24:mi:ss')
and rkdate <=
to_date('2017/1/1 18:00:00',
'yyyy-mm-dd hh24:mi:ss')
and FZLJM = '02'
group by fhrmc)
where zzl >= 5000000
)

SELECT
*
FROM
vl_user
WHERE
userID IN(
SELECT
t.userID
FROM
(SELECT
userID,prodMoney,
COUNT(userID) AS num
FROM
vl_order
WHERE
prodMoney<400 AND prodMoney>=1
GROUP BY
userID,prodMoney
HAVING
COUNT(userID)=1
) AS t
)
温馨提示:答案为网友推荐,仅供参考
相似回答