ClickHouse/dbms/tests/queries/0_stateless/00725_join_on_bug_2.sql

24 lines
852 B
MySQL
Raw Normal View History

drop table if exists t;
drop table if exists s;
2018-10-02 18:14:37 +00:00
create table t(a Int64, b Int64) engine = TinyLog;
insert into t values(1,1);
insert into t values(2,2);
create table s(a Int64, b Int64) engine = TinyLog;
insert into s values(1,1);
2018-10-02 18:14:37 +00:00
select a, b, s_a, s_b from t all left join (select a,b,a s_a, b s_b from s) using (a,b);
2018-10-02 18:14:37 +00:00
select '-';
select t.*, s.* from t all left join s using (a,b);
2018-10-02 18:14:37 +00:00
select '-';
select a,b,s_a,s_b from t all left join (select a, b, a s_a, b s_b from s) s on (s.a = t.a and s.b = t.b);
2018-10-02 18:14:37 +00:00
select '-';
select * from t all left join (select a s_a, b s_b from s) on (s_a = t.a and s_b = t.b);
2018-10-02 18:14:37 +00:00
select '-';
select a,b,s_a,s_b from t all left join (select a,b, a s_a, b s_b from s) on (s_a = t.a and s_b = t.b);
2018-10-02 18:14:37 +00:00
select '-';
select t.*, s.* from t all left join s on (s.a = t.a and s.b = t.b);
2018-10-02 18:14:37 +00:00
drop table if exists t;
drop table if exists s;