Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Std Deviation and UDFs in SQL Select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00233026
Message ID:
00234747
Vues:
47
>that's true, but SQL Server and MC Access both support it.
>Also, it is in the SQL standards. It doesn't matter how the Foxpro engine calculates it.

That I can't say - every application has its own little variations on SQL...the ones you mentioned make two passes through the data to do the work, so it will take extra time...vfp has it's own CALC way to do it, which may at least as fast or faster...

>
>Also, I wrote a UDF to calculate STDDEV in a single pass -
>(why I don't use it - it doesn't work with GROUP BY)
>here's how:
>It depends on PUBLIC variables to remember all average, count, sum and all the reqd. variables used to calculate STD. DEV.

PUBLICS shouldn't be used any more...and that's not a really single-pass. Your first pass, you get the sum. The second pass you use it to calculate the individual values (each X - SUM(X)/N)**2), etc.

But anyway, why not just use the "wheel" vfp provides, instead of trying to re-invent one? I write plenty of statistical functions in vfp for my work here, but not when they're already built in...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform