Subject Re: [firebird-support] Way to avoid many subselects
Author Arno Brinkman
Hi Sean,

> Since you're running v2+
>
> You can do:
>
> select
> inv.id,
> inv.date,
> inv.number,
> inv.ship_date
> from
> customers cus
> JOIN (
> select First 1
> id,
> date,
> number,
> ship_date
> from invoices
> where
> customer_id = cus.customer_id
> order by id desc
> ) as Inv on 1 = 1

Are you sure?
It should not be allowed to reference to an outer context from a derived table.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
http://www.databasedevelopmentforum.com

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 Firebird and Interbase users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info