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, 3020🔥, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
How To Recover a Dropped Index in Oracle? If you have the recycle bin feature turned on, dropped ind...
What Is ISAM in MySQL? ISAM (Indexed Sequential Access Method) was developed by IBM to store and ret...
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...