Snippet Name: UPDATE: Update from a SELECT statement Description: Update based on results of a SELECT statement. Also see:» TABLE: Using Select Statement With Data » Perl SQL Update Example » SELECT: Case insensitive search » SELECT: Partition Select » SELECT: Select For Update » SELECT: Using Functions » SELECT: Get DISTINCT or UNIQUE values » SELECT: Get UNIQUE and DISTINCT values » SELECT: Scalar Select » SELECT with HAVING Clause » SELECT with GROUP BY Clause » SELECT with WHERE Clause » SELECT with SAMPLE clause » SELECT placement » SELECT into a table » SELECT name columns » SELECT » UPDATE: Update a partitioned table » UPDATE: Update based on a record » UPDATE: Update Object Table » UPDATE: with RETURNING clause » UPDATE: Nested Table Update example » UPDATE: Correlated Update » UPDATE: Update from a SELECT statement » UPDATE: based on multiple returned val... » UPDATE: Update based on a query » UPDATE: Update multiple rows » UPDATE: update a specific record » UPDATE: Single row » Inserting into SELECT statement Comment: Be warned: it's amazing how much damage you can do with this kind of update when it goes wrong. Language: PL/SQL Highlight Mode: PLSQL Last Modified: March 04th, 2009
Description: Update based on results of a SELECT statement.
Also see:» TABLE: Using Select Statement With Data » Perl SQL Update Example » SELECT: Case insensitive search » SELECT: Partition Select » SELECT: Select For Update » SELECT: Using Functions » SELECT: Get DISTINCT or UNIQUE values » SELECT: Get UNIQUE and DISTINCT values » SELECT: Scalar Select » SELECT with HAVING Clause » SELECT with GROUP BY Clause » SELECT with WHERE Clause » SELECT with SAMPLE clause » SELECT placement » SELECT into a table » SELECT name columns » SELECT » UPDATE: Update a partitioned table » UPDATE: Update based on a record » UPDATE: Update Object Table » UPDATE: with RETURNING clause » UPDATE: Nested Table Update example » UPDATE: Correlated Update » UPDATE: Update from a SELECT statement » UPDATE: based on multiple returned val... » UPDATE: Update based on a query » UPDATE: Update multiple rows » UPDATE: update a specific record » UPDATE: Single row » Inserting into SELECT statement
UPDATE (<SELECT Statement>) SET <column_name> = <value> WHERE <column_name> <condition> <value>; SELECT * FROM my_table WHERE table_name LIKE '%FOO%'; SELECT * FROM my_table WHERE table_name NOT LIKE '%FOO%'; UPDATE ( SELECT * FROM my_table WHERE table_name NOT LIKE '%FOO%') SET extent_management = 'Unknown' WHERE table_name NOT LIKE '%FOO%'; SELECT * FROM my_table;