Subject | Re: [ib-support] outer join query |
---|---|
Author | Pirtea Calin Iancu |
Post date | 2002-05-20T12:38:43Z |
From: "Nick Upson"
select * from b_matdet left outer join b_order on b_matdet.b_md_worder_ref =
b_order.b_o_ref
inner join b_order_ops on b_order_ops.b_o_ref = b_matdet.b_md_worder_ref
in this case you get the same result as in your first query, provided you
have a
qualifying record in b_order_ops
Best regards,
Application Developer
Pirtea Calin Iancu
S.C. SoftScape S.R.L.
pcalin@...
> Either I've got a problem with my database or with my understanding ofouter
> joins.=
>
> I expect the same number of rows from both of the queries below
> when there are no rows on the righthand side of the left outer join
> (b_matdet.b_md_worder_ref = b_order.b_o_ref fails)
>
> but the first one returns 1 row - fine and the second returns none.
>
> select * from b_matdet left outer join b_order on b_matdet.b_md_worder_ref
> b_order.b_o_ref=
> where b_matdet.b_md_ref = 7023
>
> select * from b_matdet left outer join b_order on b_matdet.b_md_worder_ref
> b_order.b_o_refif b_order_ops(b_o_ref) points to b_matdet then maybe your query should be:
> inner join b_order_ops on b_order.b_o_ref = b_order_ops.b_o_ref
> where b_matdet.b_md_ref = 7023
>
select * from b_matdet left outer join b_order on b_matdet.b_md_worder_ref =
b_order.b_o_ref
inner join b_order_ops on b_order_ops.b_o_ref = b_matdet.b_md_worder_ref
in this case you get the same result as in your first query, provided you
have a
qualifying record in b_order_ops
Best regards,
Application Developer
Pirtea Calin Iancu
S.C. SoftScape S.R.L.
pcalin@...