How to form an efficient Join query with more than 3 tables...?

From: <masyedkasim_at_hotmail.com>
Date: Tue, 16 Nov 1999 12:24:38 GMT
Message-ID: <80rie4$qoi$1_at_nnrp1.deja.com>



Hi,

[Quoted]      I want to write an efficient join query with more than 3 tables. For example,

SELECT

[Quoted]        OOT.NO,
       OOT.BUYER_TEXT,
       OOT.SLR_CODE,
       SLR.NAME,
       PSE.STE_CODE,
       PSE.PRT_ID,
       PSO.EFFECT_FROM_DATE,
       PSO.EFFECT_TO_DATE,
       PSO.PRIORITY
     FROM
       PRO_PART_SITES PSE,           -- 80,000 rows
       PRO_PART_SITE_OOCS PSO,       -- 800,000 rows
       PRO_OPEN_ORDER_CONTRACTS OOT, -- 1000 rows
       PRO_SUPPLIERS SLR             -- 25,000 rows
     WHERE
       PSE.ORDER_FREEZE != 'Y' AND
       NVL(PSO.EFFECT_TO_DATE,SYSDATE) >=  SYSDATE AND
       NVL(PSO.EFFECT_FROM_DATE,SYSDATE) <= SYSDATE  AND
       OOT.SLR_CODE = SLR.CODE AND
[Quoted]        OOT.NO = PSO.OOT_NO AND
       PSO.PSE_ID = PSE.ID

Is there any way of ordering the tables based on the no of rows and using columns in the join condition ( to speed up the retrieval ).

[Quoted] [Quoted] Good solutions would be appreciated.

Thanks
Syed.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Nov 16 1999 - 13:24:38 CET

Original text of this message