Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting records that do NOT match a query
Message
From
07/04/1998 21:56:55
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00089645
Message ID:
00090328
Views:
29
>>
>>SELECT TABLEB.* FROM TABLEB LEFT OUTER JOIN TABLEA ;
>>  ON TABLEB.PK = TABLEA.PK ;
>>  WHERE TABLEB.PK != TABLEA.PK
>>
>>OR
>>
>>SELECT TABLEB.* FROM TABLEB LEFT OUTER JOIN TABLEA ;
>>  ON TABLEB.PK = TABLEA.PK ;
>>  WHERE TABLEA.PK = ""
>>
>
>Justok,
>
>Interesting variations, I don't if they would work or if they would be faster, maybe.

Actually, I want to compare SubQuery (Nest SQL) faster or Single Query with
Heavy task fast!

In my view, SubQuery will be faster as you try to get the useful data for
further enhancement!!

e.g. Table1 has 100,000 Records. with Field1 = 'P1001' is about 300 Records.
Table1Det has 300,000 Records. with Field1 = 'P1001' is about 600 Records.

If simple join and got data:
Select * from Table1 inner join Table1Det on ;
Table1.Field1 = Table1Det.Field1 ;
where Table1.Field1 = 'P1001'
will be quiet slow! But
Select * from Table1 where Table1.Field1 = 'P1001' ;
into Table TmpTable1
Select * from Table1Det where Table2.Field2 = 'P1001' ;
into Table TmpTable1Det
Select * from TmpTable1 inner join TmpTable1Det on ;
TmpTable1.Field1 = TmpTable1Det.Field1
Will be great faster than the first one!
Strange?! ^_^;
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Reply
Map
View

Click here to load this message in the networking platform