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"
2020-01-21, 792👍, 0💬
Popular Posts:
What Do You Need to Connect PHP to MySQL in MySQL? If you want to access MySQL database server in yo...
How To Create an Multi-Statement Table-Valued Function in SQL Server Transact-SQL? To create a multi...
How To Concatenate Two Text Values in Oracle? There are two ways to concatenate two text values toge...
Is SQL Server Transact-SQL case sensitive? No. Transact-SQL is not case sensitive. Like the standard...
How To Define an External Table in a Text File in Oracle? You can use the CREATE TABLE statement to ...