Subject | RE: [firebird-support] HOWTo PLAN Clause for FB2 |
---|---|
Author | Alan McDonald |
Post date | 2008-04-08T06:14:25Z |
> Alan McDonald wrote:Why does the server return the plan in a list which is not correlated (order
> >
> > But I'd still like to know the syntax for incorporating a
> plan (which
> > has more than one index nominated) in a select statement.
>
> Plan belongs to a select expression. In other words, this
> means a subquery.
>
> > What is the correct syntax?
>
> SELECT ...
> , (SELECT COUNT(*) FROM ERSCONTRACTORALERTS
> WHERE ERSCONTRACTORALERTS.FKCONTRACTOR=ERSCONTRACTOR.ID
> PLAN (ERSCONTRACTORALERTS INDEX (...)) ) AS ALERTCOUNT
> , (SELECT COUNT(*) FROM ERSJOB
> WHERE ERSJOB.FKCONTRACTOR=ERSCONTRACTOR.ID AND
> ERSJOB.COMDATE
> IS NULL
> PLAN (ERSJOB INDEX (...)) ) AS INCOMPJOBS
>
> ...
> FROM ERSCONTRACTOR
> WHERE ...
> PLAN (ERSCONTRACTOR INDEX (...))
>
>
> Dmitry
wise) with the select expressions?
Alan