ClickHouse/dbms/tests/queries/0_stateless/00844_join_lightee2.sql

22 lines
500 B
MySQL
Raw Normal View History

2019-06-03 17:36:27 +00:00
DROP TABLE IF EXISTS t1_00844;
DROP TABLE IF EXISTS t2_00844;
2019-02-13 00:11:49 +00:00
2019-06-03 17:36:27 +00:00
CREATE TABLE IF NOT EXISTS t1_00844 (
2019-02-13 00:11:49 +00:00
f1 UInt32,
f2 String
) ENGINE = MergeTree ORDER BY (f1);
2019-06-03 17:36:27 +00:00
CREATE TABLE IF NOT EXISTS t2_00844 (
2019-02-13 00:11:49 +00:00
f1 String,
f3 String
) ENGINE = MergeTree ORDER BY (f1);
2019-06-03 17:36:27 +00:00
insert into t1_00844 values(1,'1');
insert into t2_00844 values('1','name1');
2019-02-13 00:11:49 +00:00
2019-06-03 17:36:27 +00:00
select t1_00844.f1,t2_00844.f3 from t1_00844 all inner join t2_00844 on t1_00844.f2 = t2_00844.f1
where t2_00844.f1 = '1';
2019-02-13 00:11:49 +00:00
2019-06-03 17:36:27 +00:00
DROP TABLE t1_00844;
DROP TABLE t2_00844;