How to select second order value

Grafana 8.2.5
Database InfluxDB

If I want first order value (highest value), I use function max().
But if I want second order value. What is function for this?

Time ---------------- value
12:00:00 ------------- 20 ------------- this is min value (last order)
13:00:00 ------------- 40 ------------- this is max value (1st order)
14:00:00 ------------- 30 ------------- this is 2nd order
15:00:00 ------------- 35 ------------- this is 3rd order

I want to select 2nd order for calculation by
(max value - 2nd order value) x 120

Are you using Flux or InfluxQL?