0
点赞
收藏
分享

微信扫一扫

PG根据已有表建立新表

芭芭蘑菇 2022-07-13 阅读 51


AS(通用)

create table test(id serial, name varchar(10));
insert into test(name) values('a'),('b'),('c');
create table test2 as select * from test;

PG特有

-- 注意,test3应该是还没创建的新表
select * into test3 from test;


举报

相关推荐

0 条评论