Hi,

I'm having three tables P, C, G that are related as follows:

P - C
1 : n 

C - G
1 : n

So P is parent to it's childs in C, and C is parent to it's child G (the 
grand-child)

Now I need a left outer join on these, in SQL it looks like this:

P left join (C left join G on C.id = G.parent_id) on P.id = C.parent_id


Unfortunately, I can't do that. Adding two LEFTJOINOns makes C appear twice, 
as the resulting query looks like this:

select ... from P left join C on P.id == C.parent_id, C left join G on C.id == 
G.parent_id where ....


Now what I would need is a way to chain/nest joins, like this:

LEFTJOINOn(P, LEFTJOINOn(C, G, C.q.id == G.q.parent_id), P.q.id == 
C.q.parent_id)

Which doesn't work...

Any suggestions how to solve this with existing capabilities, or shall I 
investigate on patching SO? I'd be willing to...

-- 
>> Diez B. Roggisch
>> Developer
A  Milastraße 4 / D-10437 Berlin

T  +49 (30) 443 50 99 - 27
F  +49 (30) 443 50 99 - 99
M  +49 (179) 11 75 303
E  [EMAIL PROTECTED]
____________________________________________________________________
Geschaeftsfuehrer: Ekkehard Blome (CEO), Felix Kuschnick (CCO)
Registergericht: Amtsgericht Berlin Charlottenburg HRB 76376
UST-Id. DE 217652550

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to