I am trying to calculate the standard deviation of multiple columns for each given ID.
I have a table that shows gives me demand over time and I need to calculate volatility of the demand.
SELECT id ::Text, n0 ::numeric, n1 ::numeric, n2 ::Numeric, n3 ::numeric, n4 ::numeric, n5 ::numeric, n6 ::numeric, n7 ::numeric
FROM mytable
I would like to add another column that calculates the standard deviation from the values in in columns n0-n7 for each id.