Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MIN() MAX() in SQL on multiple fields
Message
De
07/04/2015 09:20:12
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01617834
Message ID:
01617913
Vues:
34
>Lutz :
>
>Good points. However, I only really need 6 parms so 20 is overkill. And the reason I am doing the loop is because I'm being lazy. If I need more speed I will definitely consider the case statement.
>
>George

One never know.

The CASE approach is simply n compares + 1 function call to min(), no variable created.

Your approach will need at least n loops, n assignements, n compares, n macro expansion + 2 variable assignment definition and 2 assignments
Macro expansion is very slow (and it would need 3*n of it)
Also note that is is stated endless times to not using macros expansion.

My way will work with characters or boolean or currency as well, as long as all fields are the same type (as usual with min / max)
And all it takes is a simple copy and paste.

Edit:
Or the create a quick'n'dirty VFP code to create it. :)
/Edit

:)

Lutz
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform