You can use the non-standard FROM clause.
UPDATE b
SET column1 = a.column1,
column2 = a.column2,
column3 = a.column3
FROM a
WHERE a.id = b.id
AND b.id = 1
More Related Contents:
- How do I (or can I) SELECT DISTINCT on multiple columns?
- Refactor a PL/pgSQL function to return the output of various SELECT queries
- updating table rows in postgres using subquery
- PostgreSQL parameterized Order By / Limit in table function
- Return pre-UPDATE column values using SQL only
- Casting NULL type when updating multiple rows
- Slow simple update query on PostgreSQL database with 3 million rows
- DROP FUNCTION without knowing the number/type of parameters?
- PostgreSQL convert columns to rows? Transpose?
- Bulk/batch update/upsert in PostgreSQL
- COPY with dynamic file name
- Postgres error updating column data
- Update a column of a table with a column of another table in PostgreSQL
- Functions with variable number of input parameters
- Create PostgreSQL ROLE (user) if it doesn’t exist
- PostgreSQL – dynamic value as table name [duplicate]
- PostgreSQL “Column does not exist” but it actually does
- Is SELECT or INSERT in a function prone to race conditions?
- Oracle SQL: Update a table with data from another table
- SQL UPDATE order of evaluation
- Double colon `::` notation in SQL
- Window Functions: last_value(ORDER BY … ASC) same as last_value(ORDER BY … DESC)
- I keep getting the error “relation [TABLE] does not exist”
- Export specific rows from a PostgreSQL table as INSERT SQL script
- Which datatype should be used for currency?
- How to return two columns with function
- Prepared Statement on Postgresql in Rails
- SELECT DISTINCT is slower than expected on my table in PostgreSQL
- Postgresql query between date ranges
- Why isn’t row level security enabled for Postgres views?