fixes recurring bug

This commit is contained in:
2022-10-26 05:52:48 +08:00
parent 31d823ac89
commit 3120763966
4 changed files with 24 additions and 14 deletions
+12 -1
View File
@@ -17,4 +17,15 @@ INSERT INTO t VALUES(4, 'B', 40)
INSERT INTO t VALUES(4, 'B', 80)
SELECT * FROM t
SELECT * FROM t
FUNCTION myCov(x, y) {
center_x := x - avg(x);
center_y := y - avg(y);
num := sum(center_x * center_y);
denom := sqrt(sum(center_x * center_x)) * sqrt(sum(center_y * center_y));
num / denom
}
select myCov(1,2);
-10
View File
@@ -1,10 +0,0 @@
FUNCTION myCov(x, y) {
center_x := x - avg(x);
center_y := y - avg(y);
num := sum(center_x * center_y);
denom := sqrt(sum(center_x * center_x)) * sqrt(sum(center_y * center_y));
num / denom
}
select myCov(1,2);