Subject | Re: [ib-support] outer join query |
---|---|
Author | Carl van Tast |
Post date | 2002-05-21T08:36:41Z |
On Mon, 20 May 2002 05:28:54 +0000 (UTC), uebridger@... ("Nick
Upson") wrote:
while I write this, I see Pirtea Calin Iancu has already posted a
statement which AFAICS should work for you. Here is another way:
SELECT *
FROM b_matdet m
LEFT JOIN (b_order o
INNER JOIN b_order_ops oo
ON o.b_o_ref = oo.b_o_ref)
ON m.b_md_worder_ref = o.b_o_ref
WHERE m.b_md_ref = 7023
Something like this can be used, if different attributes of the middle
table are involved in the JOINs, e.g.
SELECT *
FROM a
LEFT JOIN (b
INNER JOIN c
ON b.c_id = c.id)
ON a.b_id = b.id
WHERE a.id = 7
Kind regards
Carl van Tast
Upson") wrote:
>but the first one returns 1 row - fine and the second returns none.Nick,
>[...]
>
>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.b_o_ref = b_order_ops.b_o_ref
>where b_matdet.b_md_ref = 7023
while I write this, I see Pirtea Calin Iancu has already posted a
statement which AFAICS should work for you. Here is another way:
SELECT *
FROM b_matdet m
LEFT JOIN (b_order o
INNER JOIN b_order_ops oo
ON o.b_o_ref = oo.b_o_ref)
ON m.b_md_worder_ref = o.b_o_ref
WHERE m.b_md_ref = 7023
Something like this can be used, if different attributes of the middle
table are involved in the JOINs, e.g.
SELECT *
FROM a
LEFT JOIN (b
INNER JOIN c
ON b.c_id = c.id)
ON a.b_id = b.id
WHERE a.id = 7
Kind regards
Carl van Tast