-
HI
The SQL I am using is
update rafiq set RECIPIENTNAME = (select RECIPIENTNAME from rffragrecipient where
rafiq.shrfnbr=rffragrecipient.shrfnbr )
I am getting an error - subquery retieves more than 1 row .
Please tell em how should I write it
regards
-
You can write it like:
update rafiq set RECIPIENTNAME = (select min(RECIPIENTNAME) from rffragrecipient where
rafiq.shrfnbr=rffragrecipient.shrfnbr )
However, the reason you are getting this message is because Oracle can't find one and only one match for rafiq.shrfnbr in rffragrecipient by shrfnbr. Typically, this condition arises from either a design flaw or a misunderstanding of the data.
Jeff Hunter
-
Step 1.
Check if the query
select RECIPIENTNAME
from rffragrecipient,rafiq
where rafiq.shrfnbr=rffragrecipient.shrfnbr
returns more than 1 row.
If yes
then
Step 2.
Change the query
select RECIPIENTNAME
from rffragrecipient,rafiq
where rafiq.shrfnbr=rffragrecipient.shrfnbr
to suit your business requirement min(RECIPIENTNAME) or
max(RECIPIENTNAME) or distinct(RECIPIENTNAME) or the first value returned or the last value returned.
Soumya
still learning
-
Thanks !!
There were actually repeated rows in teh table taht I did not know .
Regards
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|