Second highest value for each id

I have a table with all the appointments information id_appoint id_doc app_date(d/m/y) 17 201 30/10/22 16 202 20/10/22 15 203 19/10/22 14 204 18/10/22 13 201 30/09/22 12 202 20/09/22 11 203 19/08/22 10 204 18/07/22 what I’m trying to get is the second highest date for each doctor’s appointment, for example THIS IS THE… Read More Second highest value for each id