Reputation: 121
How to add results of selecting query to a new column in already existing table in PostgreSQL in pgAdmin?
Results of the select query is an alteration of over columns in the same table.
Upvotes: 2
Views: 3289
Reputation: 3210
Just create the column and update data afterwards (using the command line bundled in pgadmin):
ALTER TABLE tablename ADD COLUMN colname coltype;
UPDATE tablename SET colname = yourexpression;
Upvotes: 1