Standard deviation routine in SQL? Also, SQL FTP sites? 
Author Message
 Standard deviation routine in SQL? Also, SQL FTP sites?
Has anyone written a standard deviation routine in SQL?  Also, is
there an FTP site of useful Sybase SQL stored procedures and
other code fragments on the net?

If this is a FAQ, point me in the right direction.  Will summarize if
there's interest.

Thanks in advance,
Tim Reed



Thu, 28 Dec 1995 01:28:31 GMT
 Standard deviation routine in SQL? Also, SQL FTP sites?

No, but it wouldn't be hard, e.g.,

t

#! /bin/ksh
#
# this script takes a input stream of numbers, and provides the mean
# and standard deviation for the first column.  if this isn't exactly what
# you want, try using it with the `cut' program.
#
# the standard deviation it computes is the "population standard deviation",
# while the one provided by the HP-12C calculator shows the "sample standard
# deviation", i.e., the best estimate of the real standard deviation based on
# a sample from the total population.  To see the difference, follow
# the instructions in the footnote on page 90 of the HP-12C manual, or
# ask someone who really understands statistics.
#
# written by Dannie Durand at ENSMP in France, slightly modified.
#

awk '
    BEGIN       { count = sum = carry = 0.0; printf ("mean \tstd. dev \n") }
    length > 0       { ++count ; sum = sum + $1 ; carry = carry + $1*$1       }
    END         { mu = sum/count ;
                  sigma = sqrt(carry/count - mu*mu) ;
                  printf("%g\t%g\n", mu, sigma)
                }
    '



Sat, 30 Dec 1995 01:56:26 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. SQL Aggregate for Standard Deviation?

2. SQL and Standard Deviation

3. Standard deviation function in MS SQL Server 6.5

4. T-SQL Standard Deviation Function

5. Standard Deviation - Are there any exixsting Oracle SQL Function

6. Standard Deviation - Are there any exixsting Oracle SQL Function

7. Transact SQL and Standard Deviation?

8. FTP : DataTransfer from server to a ftp site.

9. FTP Site of SQL 7.0

10. DTS FTP Task: Is it possible to get beyond the root directory of the ftp site

11. getting FTP site response in FTP custom DTS task using Internet Transfer Control - StateChanged event

12. FTP sites for PowerBuilder, Oracle, and SQL Windows?


 
Powered by phpBB® Forum Software