diff options
author | monty@narttu.mysql.fi <> | 2003-03-25 13:06:20 +0200 |
---|---|---|
committer | monty@narttu.mysql.fi <> | 2003-03-25 13:06:20 +0200 |
commit | 9a7b0ef83d9c9cd2fcd8b50a6a6e0689702dbe9f (patch) | |
tree | a39705f60353e0c451cad26a7574e39ec9e786d0 /mysql-test/r/group_by.result | |
parent | 584729430a77280e753cc4bf67d2bb6d7f94a6b8 (diff) | |
download | mariadb-git-9a7b0ef83d9c9cd2fcd8b50a6a6e0689702dbe9f.tar.gz |
Fixed bug with GROUP BY and alias
Diffstat (limited to 'mysql-test/r/group_by.result')
-rw-r--r-- | mysql-test/r/group_by.result | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 91f33e0cd9f..508094aff63 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -569,3 +569,22 @@ a MAX(b) MAKE_SET(MAX(b), 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') 1 4 c 10 43 a,b,d,f drop table t1; +create table t1 (id int not null, qty int not null); +insert into t1 values (1,2),(1,3),(2,4),(2,5); +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and cqty>1; +id sqty cqty +1 5 2 +2 9 2 +select id, sum(qty) as sqty from t1 group by id having sqty>2 and count(qty)>1; +id sqty +1 5 +2 9 +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty>2 and cqty>1; +id sqty cqty +1 5 2 +2 9 2 +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and count(qty)>1; +id sqty cqty +1 5 2 +2 9 2 +drop table t1; |