MySQL: The correct way to calculate standard deviation
<p>I have the weight of different people.</p>

<p>The average is:</p>

<pre><code>select avg(weight) as avg_weight
from table;
</code></pre>

<p>But what's the difference between <code>stddev()</code> and <code>std()</code>?  Is it possible to get the standard deviation from avg_weight?</p>

<p>Is this the correct way:</p>

<pre><code>select stddev(weight)
from table;  /* -&gt; is here where the function avg(weight) included? */
</code></pre>

<p>Or do I need something like this:</p>

<pre><code>select stddev(avg(weight))
from table;  /* (but this does not work) */
</code></pre>

<p>Thanks.</p>