Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Can I limit the number or records to return given a condition?
I need to update one field of T1 from T2. So, I tried this:
update T1 set (MyField) = (select distinct FunField from T2 where T1.ID = T2.ID);
T1's ID is a proper subset of T2's ID. In other words, each ID of T1 has a corresponding record in T2.
But, the problem is that, some IDs in T2 has multiple records, and as a result, I get this error:
ORA-01427: single-row subquery returns more than one row
T1 has nearly 7500 records and T2 has nearly 200,000 records. I've found some offending IDs from T2.
I am not sure how to handle this problem. Can I somehow limit the sub-query to return one and only one record given the condition?
Thanks in advance. Received on Thu Sep 14 2006 - 15:19:47 CDT
![]() |
![]() |