How to Update From a SELECT in Oracle
Last updated August 25, 2026 · By the SaturnSQL team
Oracle has no UPDATE ... FROM syntax. Use a correlated subquery in SET, an updatable inline view, or MERGE, usually the clearest option.
Correlated subquery
Each column pulls its new value from a subquery correlated to the outer row, and the WHERE EXISTS clause keeps rows with no match untouched.
UPDATE orders o
SET o.customer_name = (
SELECT c.name FROM customers c WHERE c.customer_id = o.customer_id
)
WHERE EXISTS (
SELECT 1 FROM customers c WHERE c.customer_id = o.customer_id
);Updatable inline view
A join expressed as an inline view can be updated directly, but Oracle requires the join to be key-preserved on the updated table, and you generally need a primary key or unique constraint on customers.customer_id for this to be allowed.
UPDATE (
SELECT o.customer_name AS old_name, c.name AS new_name
FROM orders o
JOIN customers c ON c.customer_id = o.customer_id
)
SET old_name = new_name;If you are arriving from SQL Server or Postgres, both support UPDATE ... FROM directly; Oracle does not, and the closest equivalent for anything beyond a single-column update is usually MERGE INTO ... USING ... WHEN MATCHED THEN UPDATE.
Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free