diff options
author | monty@donna.mysql.com <> | 2000-12-28 03:56:38 +0200 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-12-28 03:56:38 +0200 |
commit | c0f40d14cc36f56f5b4dba288583acd345429e4e (patch) | |
tree | c27e400395741740f2e230395445236b38db27c1 /mysql-test/t/count_distinct.test | |
parent | 361067e9150f7fa57d5b2ac722ed55df9c14cc53 (diff) | |
download | mariadb-git-c0f40d14cc36f56f5b4dba288583acd345429e4e.tar.gz |
Added support for hex strings to mysqlimport
A lot of new tests to mysqltest
Fixed bug with BDB tables and autocommit
Diffstat (limited to 'mysql-test/t/count_distinct.test')
-rw-r--r-- | mysql-test/t/count_distinct.test | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test new file mode 100644 index 00000000000..1afb548c2ad --- /dev/null +++ b/mysql-test/t/count_distinct.test @@ -0,0 +1,34 @@ +# +# Problem with count(distinct) +# + +drop table if exists t1,t2,t3; +create table t1 (libname varchar(21) not null, city text, primary key (libname)); +create table t2 (isbn varchar(21) not null, author text, title text, primary key (isbn)); +create table t3 (isbn varchar(21) not null, libname varchar(21) not null, quantity int ,primary key (isbn,libname)); +insert into t2 values ('001','Daffy','A duck''s life'); +insert into t2 values ('002','Bugs','A rabbit\'s life'); +insert into t2 values ('003','Cowboy','Life on the range'); +insert into t2 values ('000','Anonymous','Wanna buy this book?'); +insert into t2 values ('004','Best Seller','One Heckuva book'); +insert into t2 values ('005','EveryoneBuys','This very book'); +insert into t2 values ('006','San Fran','It is a san fran lifestyle'); +insert into t2 values ('007','BerkAuthor','Cool.Berkley.the.book'); +insert into t3 values('000','New York Public Libra','1'); +insert into t3 values('001','New York Public Libra','2'); +insert into t3 values('002','New York Public Libra','3'); +insert into t3 values('003','New York Public Libra','4'); +insert into t3 values('004','New York Public Libra','5'); +insert into t3 values('005','New York Public Libra','6'); +insert into t3 values('006','San Fransisco Public','5'); +insert into t3 values('007','Berkeley Public1','3'); +insert into t3 values('007','Berkeley Public2','3'); +insert into t3 values('001','NYC Lib','8'); +insert into t1 values ('New York Public Libra','New York'); +insert into t1 values ('San Fransisco Public','San Fran'); +insert into t1 values ('Berkeley Public1','Berkeley'); +insert into t1 values ('Berkeley Public2','Berkeley'); +insert into t1 values ('NYC Lib','New York'); +select t2.isbn,city,t1.libname,count(t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city,t1.libname; +select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1; +drop table t1, t2, t3; |