Subject | Re: [firebird-support] Simple question |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2004-07-28T05:47:26Z |
On 27 Jul 2004 at 13:43, jasajona wrote:
....
BEGIN
SELECT max(field1) from table INTO :m;
SELECT field2 from table fhere field1 = :m INTO :result;
END^
SY, Dimitry Sibiryakov.
>Is it possible to optimize this query:I would transform this query into SP. Something like this:
>
>select
> field2
>from
> table
>where
> field1 = ( select max(field1) from table )
....
BEGIN
SELECT max(field1) from table INTO :m;
SELECT field2 from table fhere field1 = :m INTO :result;
END^
SY, Dimitry Sibiryakov.