Subject Re: [firebird-support] Views and where clauses
Author Arno Brinkman
Hi,

> First a simple question - are views capable of using indexes when
> selected from with a where clause?

> The view would be defined as such:
>
> Create view A_Max (Column1, column2, column3, max_create_date) as
> select
> column1, column2, column3, max(created_date)
> from
> a
> group by
> column1, column2, column3;

Views that contain aggregates and unions cannot use a where clause from the
outside.
For a "aggregate view" the where clause is going into the having clause,
because you could be filtering on a aggregate function (or expression which
contains it).

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