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.