I am getting the wrong result from the oracle max function. It seems to be selecting the min date rather than the max date. I have simplified the table.
Oracle Version: "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.17.0.0.0" Table:
ID_PLCMT_EVENT NUMBER(16,0)
DT_PLCMT_END DATE
ID_CASE NUMBER(16,0)
Query:
select id_plcmt_event, dt_plcmt_end,id_case from placement where id_case=47626279;
Result:
350048317 09-MAR-21 47626279
350876791 20-MAY-21 47626279
355789596 21-NOV-22 47626279
393605551 17-FEB-23 47626279
389981360 31-JAN-23 47626279
394670566 31-DEC-12 47626279
Query:
select max(dt_plcmt_end) from placement where id_case=47626279;
Result:
31-DEC-12