6 Replies Latest reply: Feb 20, 2013 7:16 AM by Gurjeet RSS

    update query problem          -----           if id match then 'Y' else 'N'

    Gurjeet
      create table v1 (object_name ,object_id) as select OBJECT_NAME,OBJECT_ID from all_objects;
      create table v2(SUBOBJECT_NAME ,object_id) as select OBJECT_NAME,OBJECT_ID from all_objects where limit <20000;

      alter table v1 add tf char(1);


      SQL> update v1 set tf ='Y' where v1.object_id = (select v1.object_id from v1 ,v2 where v1.object_id = v2.object_id);
      update v1 set tf ='Y' where v1.object_id = (select v1.object_id from v1 ,v2 where v1.object_id = v2.object_id)
      *
      ERROR at line 1:
      ORA-01427: single-row subquery returns more than one row




      -----------more then million of records
      ---------- without use of "IN"