Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this one to many SQL line be made faster?
Message
From
29/01/2004 03:56:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/01/2004 03:48:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00871681
Message ID:
00871690
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform