SELECT
dayName,
round(sum(REVIEW_GRADE)/count(*),1) as dayAvg
FROM
(
SELECT
A.REVIEW_SEQ,
A.REVIEW_DTTM,
B.REVIEW_RATING_TYP_CCD,
B.REVIEW_GRADE,
TO_CHAR(TO_DATE(a.REVIEW_DTTM, 'yyyymmddHH24miss'),'DAY') as dayName,
TO_CHAR(TO_DATE(a.REVIEW_DTTM, 'yyyymmddHH24miss'),'D') as dayNum
FROM MTR_STORE_REVIEW a
LEFT JOIN MTR_STORE_REVIEW_RATING b
ON b.REVIEW_SEQ = a.REVIEW_SEQ AND b.REVIEW_RATING_TYP_CCD = '00'
WHERE MERCH_NO = 'M000000120'
AND b.REVIEW_RATING_TYP_CCD is not null
AND REVIEW_DTTM BETWEEN '20141124'||'000000' and '20161124'||'240000'
)GROUP BY dayName,dayNum ORDER BY dayNum;
From the above query
AND REVIEW_DTTM BETWEEN '20141124'||'000000' and '20161124'||'240000'
The error message here is
ORA-01839: Invalid date for specified month
1. 00000 - "date not valid for month specified"
It's coming out
20141124 If you change this part to 20151114, there is no error
Is this a data problem entered?
java oracle
There was an invalid date in the dummy data ㅠ<
© 2025 OneMinuteCode. All rights reserved.