Collections:
Update Values on Multiple Rows in Oracle
How To Update Values on Multiple Rows in Oracle?
✍: FYIcenter.com
If the WHERE clause in an UPDATE matches multiple rows, the SET clause will be applied to all matched rows. This rule allows you to update values on multiple rows in a single UPDATE statement. Here is a good example:
UPDATE fyi_links SET counts = 9, notes = 'Wrong URL' WHERE id >= 250; 3 rows updated. SELECT * FROM fyi_links WHERE id >= 250; ID URL NOTES COUNTS CREATED ----- -------------------- ------------ ------- --------- 250 Retail Sales.com Wrong URL 9 07-MAY-06 260 Recruiting.com Wrong URL 9 07-MAY-06 270 Payroll.com Wrong URL 9 07-MAY-06
This statement updated 3 rows with the same new values on all 3 rows.
⇒ Use Existing Column Values in SET Clause in Oracle
⇐ Update Values in a Table in Oracle
2020-01-21, 3206🔥, 0💬
Popular Posts:
How To Count Rows with the COUNT(*) Function in SQL Server? If you want to count the number of rows,...
How to set the current database in SQL Server? Once you are connected to the SQL Server, you should ...
What Happens If the Imported Table Already Exists in Oracle? If the import process tries to import a...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...
What Is Transport Network Substrate (TNS) in Oracle? TNS, Transport Network Substrate, is a foundati...