Subject Re: [firebird-support] left join
Author Helen Borrie
At 08:44 PM 7/03/2005 +0000, you wrote:



>have tried to make such query:
>
>select * from TABLE1 a
>left join ( select * from TABLE2 a2 where a2."Val" = :Val and a2."Pos"
>= :Pos ) b
>on a."ID" = b."ID_ref"
>
>it seems, that FB1.5 don't support such subqueries (memory tables),

"derived tables" - not until Fb 2 and not using quite your syntax.

>how to rewrite query to get working FB1.5 query?

Well, the derived table seems redundant for this example, which appears to
be a straightforward left join.

select a.*, a2.*
from TABLE1 a
left join TABLE2 a2
on a."ID" = a2."ID_ref"
where a2."Val" = :Val
and a2."Pos" = :Pos

./hb