STD(expression)

Description: Returns the standard deviation of expression. Generally used with GROUP BY clause, but otherwise operates on all rows returned.

Example:

SELECT city_name, STD(temperature)
  FROM weather
  GROUP BY city_name

returns the standard deviation of temperatures recorded for each city in table weather.

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.