Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save query as a table with Postgresql

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.

like image 304
Jayson Fetterley Avatar asked Mar 11 '26 03:03

Jayson Fetterley


1 Answers

If you have a select statement you can execute a CTAS

CREATE TABLE <table name> AS (
SELECT STATEMENT
)
like image 200
Haleemur Ali Avatar answered Mar 12 '26 16:03

Haleemur Ali