使用Postgresql将查询另存为表 [英] Save query as a table with Postgresql

查看:171
本文介绍了使用Postgresql将查询另存为表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Postgresql查询输出另存为表?与Access中的maketable查询类似。我希望能够将其他表连接到查询输出,并制作一个新表将使生活变得美好。我正在使用Navicat执行查询。

How do you save a postgresql query output as a table? Similar to the maketable query within Access. I want to be able to join other tables to the query output and making a new table would make life good. I am using Navicat to execute queries.

推荐答案

如果您有 select语句您可以执行CTAS

If you have a select statement you can execute a CTAS

CREATE TABLE <table name> AS (
SELECT STATEMENT
)

这篇关于使用Postgresql将查询另存为表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆