0

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?

4

1 回答 1

2
insert into t4
select * from t1
union all
select * from t2
union all
select * from t3

或者,如果您想在选择期间创建表:

select * into t4 from t1
union all
select * from t2
union all
select * from t3;

SQL 提琴示例

于 2013-07-21T18:28:09.923 回答