statement ok
create table t1 (v1 int not null primary key, v2 int not null);

statement ok
create table t2 (v1 int not null primary key, v2 int not null);

statement ok
create table t3 (v1 int not null primary key, v2 int not null);

statement ok
insert into t1 values (1, 1), (4, 6), (3, 2), (2, 1);

query II rowsort
select * from t1;
----
1 1
2 1
3 2
4 6

statement ok
select * into t2 from t1;

statement ok
select v2, v1 into t3 from t2 where v2 != 6;

query II rowsort
select * from t2;
----
1 1
2 1
3 2
4 6

query II rowsort
select * from t3;
----
1 1
2 1
3 2

statement ok
drop table t1;

