Subject Re: [firebird-support] Simple question
Author Arno Brinkman
Hi,

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

> what's wrong with
> select max(field1), field2 from table

That it doesn't work :-D
Field2 must also be in a aggregate function or GROUP BY clause.


Comming back to the original question.
An DESC Index on Field1 would help in this case, but how many duplicates are
there (or gona be) on Field1?

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81