Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can this one to many SQL line be made faster?
Message
De
29/01/2004 03:56:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/01/2004 03:48:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00871681
Message ID:
00871690
Vues:
18
>I'd try a similar variation
>
>Select b.cfk1, b.cfk2, a.ctype;
>	FROM  vcf!many b ;
>	INNER Join vcf!one a ON  b.cfk1 = a.cid;
>        WHERE (b.namount1 + b.namount2 <> 0) or ;
>              (b.namount3 <> 0 and a.ctype$"F8" ) ;
>	GROUP By b.cfk1, b.cfk2
>
>which should use short circuiting a bit better.
>Perhaps an index on namount1 + namount2 in vcf!one
>speeds things up - check the optimizing results,
>since I am not sure about <> being optimized.
>If it isn't, try
>
>
>WHERE (b.namount1 + b.namount2 > 0) or ;
>            (b.namount1 + b.namount2 < 0) or ;
>            (b.namount3 <> 0 and a.ctype$"F8" ) ;
>
>
>HTH
>
>thomas

At least = is optimized :) !(a=b) would work I think. I was trying to avoid OR completely as I always found it to be problematic in SQL.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform