Save query as a table with Postgresql
Asked Answered
E

1

12

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.

Emmer answered 12/3, 2015 at 6:10 Comment(2)
postgresql.org/docs/9.4/static/sql-selectinto.htmlPiscatory
possible duplicate of SELECT .. INTO to create a table in PL/pgSQLPiscatory
A
17

If you have a select statement you can execute a CTAS

CREATE TABLE <table name> AS (
SELECT STATEMENT
)
Amarillas answered 12/3, 2015 at 6:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.