Home All Groups Group Topic Archive Search About
Author
13 Jan 2006 6:10 PM
Bahman
Hello!

I have a problem with my sql server.

When I run: select stdev(sales), avg(sales) from salestable

I get: standard deviation: 65, average: 63

Which is garbage.

What would be the correct syntax to get the stdev? What would I have to tell
the sql server?

Thank you very much for your help!

-Bahman

Author
13 Jan 2006 6:41 PM
Steve Kass
Why do you think the answer you get is garbage?  If you think it's wrong,
please give sample data and expected results that differ from the answer
you're getting.

declare @s table (
  i int
)
insert into @s values (17)
insert into @s values (109)
select stdev(i), avg(i) from @s

Steve Kass
Drew University

Show quote
"Bahman" <Bah***@discussions.microsoft.com> wrote in message
news:AE835638-C563-45CE-9DC4-EBB7C24DBB10@microsoft.com...
> Hello!
>
> I have a problem with my sql server.
>
> When I run: select stdev(sales), avg(sales) from salestable
>
> I get: standard deviation: 65, average: 63
>
> Which is garbage.
>
> What would be the correct syntax to get the stdev? What would I have to
> tell
> the sql server?
>
> Thank you very much for your help!
>
> -Bahman

AddThis Social Bookmark Button