Collections:
Error: Single-Row Subquery Returns More Than One Row in Oracle
What Happens If the UPDATE Subquery Returns Multiple Rows in Oracle?
✍: FYIcenter.com
If a subquery is used in a UPDATE statement, it must return exactly one row for each row in the update table that matches the WHERE clause. If it returns multiple rows, Oracle server will give you an error message. To test this out, you can try the following tutorial exercise:
UPDATE fyi_links SET (notes, created) = (SELECT last_name, hire_date FROM employees WHERE employee_id < id) WHERE id < 110; ERROR at line 1: ORA-01427: single-row subquery returns more than one row
The problem is the criteria in the subquery: "employee_id < id"
⇒ Delete an Existing Row from a Table in Oracle
⇐ Use Values from Other Tables in UPDATE in Oracle
2020-01-21, 2382🔥, 0💬
Popular Posts:
What Is a Dynamic Performance View in Oracle? Oracle contains a set of underlying views that are mai...
How To Enter Unicode Character String Literals in SQL Server Transact-SQL? Unicode characters are mu...
How To Convert Numeric Values to Character Strings in MySQL? You can convert numeric values to chara...
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Somet...
How To Look at the Current SQL*Plus System Settings in Oracle? If you want to see the current values...