Problem and Solutions
SQL Oracle select second max [duplicate] ?
By M.K. Verma · 4 May 2022
![SQL Oracle select second max [duplicate] ?](/_next/image?url=https%3A%2F%2Fserveapi.trimwebsolutions.com%2Fuploads%2Flegacy%2Fblog%2F16516771051651677105.jpg&w=3840&q=65)
try this if you want 2nd max by id_dependent
-- untested
select id_dependent, max(data) from
gest gest_out where data not in
(SELECT MAX (data), id_dependent
FROM gest gest_in where gest_out.id_dependent = gest_in.id_dependent
group by id_dependent)
group by id_dependent