SELECT
a.STR_CODE,
c.STR_NAME,
c.BUSI_NO,
c.VAN_COMP,
c.VAN_ID,
COUNT(CASE WHEN a.DATES between '20220101' and '20221230' then '1' end) as 1월
FROM DT061TBL a
JOIN DT063TBL b
ON a.DATES = b.DATES
AND a.STR_CODE = b.STR_CODE
AND a.POS_NO = b.POS_NO
AND a.TRXN_NO = b.TRXN_NO
AND a.SEQ_NO = b.SEQ_NO
JOIN AM010TBL c
ON a.STR_CODE = c.STR_CODE
JOIN DT060TBL d
ON a.DATES = d.DATES
AND a.STR_CODE = d.STR_CODE
AND a.POS_NO = d.POS_NO
AND a.TRXN_NO = d.TRXN_NO
WHERE c.STR_CODE = '1471' and b.PAY_TYPE = '03' and a.DATES between '20220101' and '20221231' and d.canc_type = '0'
GROUP BY a.STR_CODE,
c.STR_NAME,
c.BUSI_NO,
c.VAN_COMP,
c.VAN_ID ;
해당쿼리를 실행했을때 볼드친부분이 에러가납니다 alias를 지우면 정상적으로 실행되네요 이유가 뭔지 알 수 있을까요?