Update: Update Based On A Query

Description: Update one or more rows based on the results of a query.

UPDATE <table_name>
SET <column_name> = (
  SELECT <column_name>
  FROM <table_name
  WHERE <column_name> <condition> <value>)
WHERE <column_name> <condition> <value>;

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.