Here the query:
Same Table:
UPDATE table_name
SET column1 = column2
Different Table:
UPDATE table_name1
SET column1 = (
SELECT column2
FROM table_name2
WHERE table_name1.id = table_name2.id
);
More Related Contents:
- What is the difference between UNION and UNION ALL?
- How can I do an UPDATE statement with JOIN in SQL Server?
- Recommended SQL database design for tags or tagging [closed]
- Select First Row of Every Group in sql [duplicate]
- Why does NULL = NULL evaluate to false in SQL server
- The multi-part identifier could not be bound
- must appear in the GROUP BY clause or be used in an aggregate function
- How to insert a line break in a SQL Server VARCHAR/NVARCHAR string
- MySQL number of items within “in clause”
- GROUP BY / aggregate function confusion in SQL
- Possible to perform cross-database queries with PostgreSQL?
- Mixing implicit and explicit JOINs
- Fastest way to update 120 Million records
- Calendar Table – Week number of month
- how can I Update top 100 records in sql server
- What’s the proper index for querying structures in arrays in Postgres jsonb?
- How can I have NHibernate only generate the SQL without executing it?
- get next sequence value from database using hibernate
- Selecting Random Rows in MySQL
- concatenate two database columns into one resultset column
- SQLite and custom order by
- Update a table with join?
- How can I compare time in SQL Server?
- Is there any way to flush output from PL/SQL in Oracle?
- Combine two columns and add into one new column
- SQL: capitalize first letter only [duplicate]
- SQL: Two select statements in one query
- How to execute a stored procedure inside a select query
- SQL Inner Join On Null Values
- PostgreSQL: Full Text Search – How to search partial words?