mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-06-09 06:41:19 +03:00
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
|
|
#-- source ../include/have_innodb.inc
|
|
|
|
--disable_warnings
|
|
DROP DATABASE IF EXISTS mcol5195;
|
|
--enable_warnings
|
|
|
|
CREATE DATABASE mcol5195;
|
|
|
|
USE mcol5195;
|
|
|
|
create table t1 (a int, b int) engine=columnstore;
|
|
create table t2 (a int, b int) engine=columnstore;
|
|
|
|
insert into t1 values (1, 2), (1, 3), (1, 4), (2, 5), (2, 6), (2, 7);
|
|
insert into t2 values (1, 2), (1, 2), (1, 4), (2, 5), (2, 6), (2, 8);
|
|
|
|
--sorted_result
|
|
select * from t1, t2 where t1.a = t2.a and t2.b = (select max(b) from t2 where t1.a = t2.a);
|
|
--sorted_result
|
|
select * from t1, t2 where t1.a = t2.a and t2.b < (select max(b) from t2 where t1.a = t2.a);
|
|
--sorted_result
|
|
select * from t1, t2 where t1.a = t2.a and t2.b > (select max(b) from t2 where t1.a = t2.a);
|
|
|
|
--sorted_result
|
|
select * from t1, t2 where t1.a = t2.a and t1.b = (select avg(t2.b) from t2 where t1.a = t2.a group by t2.a);
|
|
--sorted_result
|
|
select * from t1, t2 where t1.a = t2.a and t2.b < (select avg(t2.b) from t2 where t1.a = t2.a group by t2.a);
|
|
--sorted_result
|
|
select * from t1, t2 where t1.a = t2.a and t2.b > (select avg(t2.b) from t2 where t1.a = t2.a group by t2.a);
|
|
|
|
drop table t1;
|
|
drop table t2;
|
|
DROP DATABASE mcol5195;
|