|Subject||RE: [firebird-support] HOWTo PLAN Clause for FB2|
> 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
> IS NULL
> PLAN (ERSJOB INDEX (...)) ) AS INCOMPJOBS
> FROM ERSCONTRACTOR
> WHERE ...
> PLAN (ERSCONTRACTOR INDEX (...))
wise) with the select expressions?