mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Test re-grouping
This commit is contained in:
@@ -373,3 +373,23 @@ CONCAT(a, b) count(*)
|
||||
abcdef 1
|
||||
hijklm 2
|
||||
DROP TABLE t1;
|
||||
drop table if exists t1;
|
||||
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
|
||||
insert into t1 values (1,2,1,4);
|
||||
insert into t1 values (1,2,2,4);
|
||||
insert into t1 values (1,2,3,4);
|
||||
insert into t1 values (1,2,4,4);
|
||||
insert into t1 values (1,1,1,4);
|
||||
insert into t1 values (1,1,2,4);
|
||||
insert into t1 values (1,1,3,4);
|
||||
insert into t1 values (1,1,4,4);
|
||||
insert into t1 values (1,3,1,4);
|
||||
insert into t1 values (1,3,2,4);
|
||||
insert into t1 values (1,3,3,4);
|
||||
insert into t1 values (1,3,4,4);
|
||||
select One, Two, sum(Four) from t1 group by One,Two;
|
||||
One Two sum(Four)
|
||||
1 1 16
|
||||
1 2 16
|
||||
1 3 16
|
||||
drop table if exists t1;
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
|
||||
insert into t1 values (1,2,1,4);
|
||||
insert into t1 values (1,2,2,4);
|
||||
insert into t1 values (1,2,3,4);
|
||||
insert into t1 values (1,2,4,4);
|
||||
insert into t1 values (1,1,1,4);
|
||||
insert into t1 values (1,1,2,4);
|
||||
insert into t1 values (1,1,3,4);
|
||||
insert into t1 values (1,1,4,4);
|
||||
insert into t1 values (1,3,1,4);
|
||||
insert into t1 values (1,3,2,4);
|
||||
insert into t1 values (1,3,3,4);
|
||||
insert into t1 values (1,3,4,4);
|
||||
select One, Two, sum(Four) from t1 group by One,Two;
|
||||
One Two sum(Four)
|
||||
1 1 16
|
||||
1 2 16
|
||||
1 3 16
|
||||
drop table if exists t1;
|
||||
@@ -283,3 +283,19 @@ SELECT 1 FROM t1 GROUP BY CONCAT(a, b);
|
||||
INSERT INTO t1 values ('hij','klm');
|
||||
SELECT CONCAT(a, b),count(*) FROM t1 GROUP BY 1;
|
||||
DROP TABLE t1;
|
||||
drop table if exists t1;
|
||||
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
|
||||
insert into t1 values (1,2,1,4);
|
||||
insert into t1 values (1,2,2,4);
|
||||
insert into t1 values (1,2,3,4);
|
||||
insert into t1 values (1,2,4,4);
|
||||
insert into t1 values (1,1,1,4);
|
||||
insert into t1 values (1,1,2,4);
|
||||
insert into t1 values (1,1,3,4);
|
||||
insert into t1 values (1,1,4,4);
|
||||
insert into t1 values (1,3,1,4);
|
||||
insert into t1 values (1,3,2,4);
|
||||
insert into t1 values (1,3,3,4);
|
||||
insert into t1 values (1,3,4,4);
|
||||
select One, Two, sum(Four) from t1 group by One,Two;
|
||||
drop table if exists t1;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
|
||||
insert into t1 values (1,2,1,4);
|
||||
insert into t1 values (1,2,2,4);
|
||||
insert into t1 values (1,2,3,4);
|
||||
insert into t1 values (1,2,4,4);
|
||||
insert into t1 values (1,1,1,4);
|
||||
insert into t1 values (1,1,2,4);
|
||||
insert into t1 values (1,1,3,4);
|
||||
insert into t1 values (1,1,4,4);
|
||||
insert into t1 values (1,3,1,4);
|
||||
insert into t1 values (1,3,2,4);
|
||||
insert into t1 values (1,3,3,4);
|
||||
insert into t1 values (1,3,4,4);
|
||||
select One, Two, sum(Four) from t1 group by One,Two;
|
||||
drop table if exists t1;
|
||||
Reference in New Issue
Block a user