Subject Re: [firebird-support] Simple question
Author Dimitry Sibiryakov
On 27 Jul 2004 at 13:43, jasajona wrote:

>Is it possible to optimize this query:
>
>select
> field2
>from
> table
>where
> field1 = ( select max(field1) from table )

I would transform this query into SP. Something like this:

....
BEGIN
SELECT max(field1) from table INTO :m;
SELECT field2 from table fhere field1 = :m INTO :result;
END^

SY, Dimitry Sibiryakov.