Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help forming field value
Message
From
02/04/2000 13:47:48
 
 
To
01/03/2000 15:34:05
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00340063
Message ID:
00354043
Views:
21
>sum(a.tvol)-NVL(sum(b.totcxlvol),000) as tvoladj;
>or
>NVL(sum(a.tvol)-sum(b.totcxlvol),sum(a.tvol) ) as tvoladj;
>
>Which syntax is better?
>
>I was wondering if the duplicate occurance of "sum(a.tvol)" was a performance killer.

I think the correct phrasing would be:

SUM(a.tvol) - SUM(NVL(b.totcxlvol,000)) as tvoladj

since the occurance of b.totcxlvol might be null on any given instance, rahter than the sum being NULL; I'm not certain that this applies inside the SUM() phrase in a select, but try the following to become a potentially unhappy camper:

? 3 + NULL
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform