我有以下 SQL 查询
SELECT
max (bt.NAME) "Batch Type",
max(st.name) "Submission Status",
count(sce.CLIP_POINT)--where sce.ACODE is not null
,count(sce.CLIP_POINT)--where sce.ACODE is null
,sum(sce.CLIP_POINT)--where sce.ACODE is not null
,sum(sce.CLIP_POINT)--where sce.ACODE is null
from SUBMISSION_DATA_ENTRY sde,
BATCH_PROCESSOR bp, status st,SUBMISSION_CLIP_ENTRY sce,
SUBMISSION_PERIOD sp,BATCH_TYPE bt
where sde.sub_perd_id=sp.sub_perd_id
and sde.bpr_pk=bp.bpr_pk and sde.sts_pk=st.sts_pk
and sce.sde_pk=sde.sde_pk
and bt.bat_pk =bp.bat_pk
group by bt.bat_pk, st.sts_pk;
在这里,我需要应用两个计数,一个用于 sce.ACODE 不为空,另一个用于 sce.ACODE 为空。我如何计算具有不同条件的同一列。请帮忙
Edit
如何对具有不同条件的同一列求和