diff options
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/func_group.result | 40 | ||||
-rw-r--r-- | mysql-test/r/having.result | 4 | ||||
-rw-r--r-- | mysql-test/r/select.result | 16 |
3 files changed, 32 insertions, 28 deletions
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index c1f36283ab0..409fd110ab9 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -42,21 +42,21 @@ insert into t1 values (null,null,''); select count(distinct a),count(distinct grp) from t1; count(distinct a) count(distinct grp) 6 3 -select sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1; -sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) -21 6 3.5000 1.7078 7 0 1 6 E -select grp, sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; -grp sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) -NULL 0 0 NULL NULL 0 0 NULL NULL -1 1 1 1.0000 0.0000 1 1 1 1 a a -2 5 2 2.5000 0.5000 3 2 2 3 b c -3 15 3 5.0000 0.8165 7 4 4 6 C E -select grp, sum(a)+count(a)+avg(a)+std(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; +select sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1; +sum(a) count(a) avg(a) std(a) variance(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) +21 6 3.5000 1.7078 2.9167 7 0 1 6 E +select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; +grp sum(a) count(a) avg(a) std(a) variance(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) +NULL 0 0 NULL NULL NULL 0 0 NULL NULL +1 1 1 1.0000 0.0000 0.0000 1 1 1 1 a a +2 5 2 2.5000 0.5000 0.2500 3 2 2 3 b c +3 15 3 5.0000 0.8165 0.6667 7 4 4 6 C E +select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; grp sum NULL NULL 1 7 -2 20 -3 44.816496580928 +2 20.25 +3 45.483163247594 create table t2 (grp int, a bigint unsigned, c char(10)); insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp; replace into t2 select grp, a, c from t1 limit 2,1; @@ -72,14 +72,14 @@ CREATE TABLE t1 (id int(11),value1 float(10,2)); INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00); CREATE TABLE t2 (id int(11),name char(20)); INSERT INTO t2 VALUES (1,'Set One'),(2,'Set Two'); -select id, avg(value1), std(value1) from t1 group by id; -id avg(value1) std(value1) -1 1.000000 0.816497 -2 11.000000 0.816497 -select name, avg(value1), std(value1) from t1, t2 where t1.id = t2.id group by t1.id; -name avg(value1) std(value1) -Set One 1.000000 0.816497 -Set Two 11.000000 0.816497 +select id, avg(value1), std(value1), variance(value1) from t1 group by id; +id avg(value1) std(value1) variance(value1) +1 1.000000 0.816497 0.666667 +2 11.000000 0.816497 0.666667 +select name, avg(value1), std(value1), variance(value1) from t1, t2 where t1.id = t2.id group by t1.id; +name avg(value1) std(value1) variance(value1) +Set One 1.000000 0.816497 0.666667 +Set Two 11.000000 0.816497 0.666667 drop table t1,t2; create table t1 (id int not null); create table t2 (id int not null,rating int null); diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index a33ce457176..bd1bd523964 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -62,4 +62,8 @@ select Fld1, max(Fld2) from t1 group by Fld1 having std(Fld2) is not null; Fld1 max(Fld2) 1 20 3 50 +select Fld1, max(Fld2) from t1 group by Fld1 having variance(Fld2) is not null; +Fld1 max(Fld2) +1 20 +3 50 drop table t1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 46343eb8248..37943ec1189 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2656,14 +2656,14 @@ companynr count(*) 58 23 53 4 50 11 -select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1) from t2 where companynr = 34 and fld4<>""; -count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) -70 absentee vest 17788966 254128.0857 3272.5940 -select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1) from t2 group by companynr limit 3; -companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) -00 82 Anthony windmills 10355753 126289.6707 115550.9757 -29 95 abut wetness 14473298 152350.5053 8368.5480 -34 70 absentee vest 17788966 254128.0857 3272.5940 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 +select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3; +companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087 +29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026 +34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069 select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10; companynr t2nr count(price) sum(price) min(price) max(price) avg(price) 37 1 1 5987435 5987435 5987435 5987435.0000 |