Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Std Deviation and UDFs in SQL Select
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00233026
Message ID:
00234747
Views:
45
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform