0Pricing
SQL Academy · Lesson

UPDATE with FROM and JOIN-style Updates

Update rows using values from another table with UPDATE ... FROM (PostgreSQL) and the standard MERGE statement.

Basic UPDATE

Change values in matching rows:

UPDATE users SET full_name = 'Alice Adams' WHERE id = 1;

Multiple Columns

Comma-separated SET list:

UPDATE users
SET full_name = 'Alice', last_login = NOW(), visits = visits + 1
WHERE id = 1;

All lessons in this course

  1. INSERT with Multiple Rows
  2. UPSERT: ON CONFLICT DO UPDATE (PostgreSQL)
  3. UPDATE with FROM and JOIN-style Updates
  4. DELETE with USING and Safe Patterns
← Back to SQL Academy