Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I try to update a column of a table with two columns merged into one from anther table

Christian Pitet 244 hours ago

Hi,

Under Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.29.0.1.0, I try to update a column on a table from two columns merged into one. I try this update statement :

UPDATE AD_NOTATION_BAK a 
SET a.NOM_BENEVOLE = (SELECT b.PRÉNOM || ' ' || b.NOM FROM AD_BENEVOLE b)
WHERE a.BENEVOLE IN (Select id from ad_benevole b WHERE a.BENEVOLE = b.ID) ;

a.BENEVOLE contains the primary key of the table AD_BENEVOLE.

But I get an error :

Error "ORA-01427: Single-row subquery returns more than one row"

I have verified that the table AD_BENEVOLE does not contains duplicate record on id which is the primary key :

SELECT ID, COUNT(*) AS “Count” FROM AD_BENEVOLE
GROUP BY ID
HAVING COUNT(*) > 1;

No rows returned. Same thing for AD_NOTATION_BAK, no duplicate values of the primary key.

Where is my error ?

Best regards.

This post has been answered by Jonathan Lewis on Dec 18 2025
Jump to Answer
Comments
Post Details
Added 44 hours ago
5 comments
69 views