WITH T AS
(
SELECT 20 AS DATA1, 2 AS DATA2 FROM DUAL
UNION ALL SELECT 30, 3 FROM DUAL
UNION ALL SELECT 40, 4 FROM DUAL
)
SELECT STDDEV(DATA1), STDDEV(DATA2)
FROM T
위의 20, 2, 30, 3, 40, 4 의 표준편차를 구해야하는데
이상한 값이 나오더라고요.
WITH T AS
(
SELECT 20 AS DATA1 FROM DUAL
UNION ALL SELECT 30 FROM DUAL
UNION ALL SELECT 40 FROM DUAL
UNION ALL SELECT 2 FROM DUAL
UNION ALL SELECT 3 FROM DUAL
UNION ALL SELECT 4 FROM DUAL
)
SELECT STDDEV(DATA1)
FROM T
위와같이 테이블 구조를 변경해서 하면 값이 잘 나오는데
좋은 방법이 있을까요?
|