Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL optimization
Message
De
28/12/1998 12:47:33
 
 
À
28/12/1998 12:40:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00170828
Message ID:
00170837
Vues:
19
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform