SQLTeam.com | Weblogs | Forums

Update query with three joins

HI Team,

I need help in the below query :

Req: I HAVE THREE COLUMNS FROM THREE TABLES

TABLE3.FIRSTNAME TABLE3.LASTNAME TABLE1.ACCNAME
HAR WAL HAR WAL
ATT SSS ATT SSS

I CREATED BELOW UPDATE QUERY TO UPDATE TABLE AND I NEED TO UPDATE TABLE 1ACCNAME WITH FISRTNAME LASTNAME BUT BELOW QUERY THROWING ERROR :"Ora-01427 single-row subquery returns more than one row"

IM USING oRACLE SQL DEV

UPDATE BPD.TABLE1 SET BPD.TABLE1.ACCNAME = ( select BPD.TABLE3.FIRSTNAME || ' ' || BPD.TABLE3.LASTNAME from ((BPD.TABLE1 INNER JOIN BPD.TABLE2 ON BPD.TABLE2.ACCID = BCPD.TABLE1.ID)
INNER JOIN BPD.TABLE3 ON BCPD.TABLE2.CONTACTID =BPD.TABLE.ID ) WHERE BPD.TABLE1.ID IN ( select BCPD.TABLE1.ID from BCPD.TABLE1 where rownum >=1));

Please be aware that this is a SQL Server forum. You're likely to have better success at an Oracle forum for an Oracle-related q.