Reputation: 331
I have 3 tables (t1, t2, t3) in postgresql. they all have same number of columns (168 cols) with same type and overall 300k rows.
How can I add all of them in one table?
Upvotes: 0
Views: 79
Reputation: 117337
insert into t4
select * from t1
union all
select * from t2
union all
select * from t3
or, if you want to create table during select:
select * into t4 from t1
union all
select * from t2
union all
select * from t3;
Upvotes: 2