I have 3 tables SECTION and BRAND and MODEL. SECTION is related to BRAND and to MODEL via two foreign keys. I would like to select ALL SECTIONs whether the FKs are null or not and fetch the BRAND and MODEL attributes in one SQL statement. In other words I need a double outer join:
SELECT SECTION.SECTION_PK, SECTION.SECTION_NAME, SECTION.BRAND_FK, SECTION.MODEL_FK, BRAND.BRAND_NAME MODEL.MODEL_NAME FROM SECTION left outer join MODEL on MODEL_PK =MODEL_FK left outer join BRAND on BRAND_PK =BRAND_FK
I have seen some old discussion threads from 2002 suggesting that Torque does not support outer joins. Is this still the case?
If so, can anyone suggest an efficient work-around? I'd rather not fetch the other table's attributes in a loop.
=======================================================================
2nd Problem
-----------
Scenario as above but this time SECTION has two foreign key relationships with the same table:
SELECT SECTION.SECTION_PK, SECTION.SECTION_NAME, SECTION.BRAND_1_SKIPPED_FK, SECTION.BRAND_2_SKIPPED_FK, BRAND.BRAND_NAME (1) BRAND.BRAND_NAME (2) FROM SECTION left outer join BRAND on BRAND_PK =BRAND_1_SKIPPED_FK left outer join BRAND on BRAND_PK =BRAND_2_SKIPPED_FK
(the above obviously doens't work as SQL statement but ...)
How would I specify the same output columns twice? How can I implement this logic using Torque?
--
Regards,
Tarlika Elisabeth Schmitz
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
