Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL optimization
Message
From
28/12/1998 12:47:33
 
 
To
28/12/1998 12:40:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00170828
Message ID:
00170837
Views:
17
>select max(column1 - ###) from table1
>
>How Can this be optimized? There is an index on column1. ### is a user selectable numeric value.

Since regardless of value, ### is a constant, and MAX() always returns a single row per grouping, you could optimize by:

SELECT MAX(column1) AS MaxColumn1 FROM Table1 INTO CURSOR TEMP
SELECT MaxColumn1 - ### AS Result FROM TEMP
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