SQL return ORA-00937 error on oracle 19g but noe error on 11g
the following SQL statement return result correctly when execute on oracle 11.2.0 but return ORA-00937 error when execute on oracle 19.0.0, thus we should add group by in subquery which using max() function, if any solution so that we needn't modify the SQL statement , and it can return result as executing on oracle 11.2.0...
SELECT r.RATE,r.rate_index
FROM RATE_INDEX_VALUE r,
(SELECT max(RATE_DATE) as RATE_DATE, RATE_INDEX
FROM RATE_INDEX_VALUE
WHERE RATE_INDEX = rpad(trim('B_2W'), 16, ' ')
AND '20200101' >= RATE_DATE) s
WHERE r.RATE_DATE = s.RATE_DATE
AND r.RATE_INDEX = rpad(trim('B_2W'), 16, ' ')