Subject Re: [ib-support] second most recent value
Author Woody
From: "Duilio Foschi" <dedalus@...>
> I have records like this
>
> qty numeric (15,2)
> d_mov date
>
> If I want the most recent value of QTY, I can write
>
> "select first 1 qty from Table1 order by d_mov desc"
>
> However, I want the _second_ most recent QTY value.
>
> How can I get that ?

select first 1 qty from Table1 where d_mov < (select max(d_mov) from Table
1) order by d_mov desc


HTH
Woody (TMW)