don123 wrote:You've got more than one row in twyinfo that matches the id from twypoly. You need to make sure that
hi, please help me to resolve this, working with oracle 11g.
update twypoly t1 set t1.twyindex=(select twyindex from twyinfo t2 where t2.id=t1.id);
the error message is:
ERROR at line 1:
ORA-01427: single-row subquery returns more than one row
don123 wrote:Well, there we are then. You have duplicates for a particular id.
i have provided sample data as there are hundreds of rows.
can you provide the SQL ?
select id ,count(*) from twyinfo having count(*) > 1 group by id;
don123 wrote:I don't know your data or the business reason why there are duplicates. It may be there shouldn't be and you need to clean up the data.
hi, please see the output, as you said, there are duplicates, how to resolve this ? any solution ?
SQL> select id, count(*) from twyinfo having count(*) > 1 group by id;
6 rows selected.