title: update oracle dara with select statement
body: <p>I have a table that contains millions of records.I want to update approximately 30.000 rows.
  I can get data with <code>select * from customer where city is not null</code>. This query returns 30.000 rows.I want to update only that 30000 rows like that</p>
  <p>update customer set city = null where (select .....)</p>
  <p>I want to update 30.000 rows not all table so I have to use select statement otherwise plain update takes long time :(</p>
  <p>Do you have any idea? How can i write a query or script to complete this process.</p>
  <p>My trigger is like that,</p>
  <pre><code>TRIGGER &quot;CUSTOMER_HIST_TR&quot; AFTER
  UPDATE OF city ON Customer  REFERENCING NEW AS NEW OLD AS OLD FOR EACH 
  ROW
   DECLARE
    v_osuser varchar2(20);
    v_terminal varchar2(20);
    v_username varchar2(20);
    v_city varchar2(2);
   BEGIN
  if nvl(:new.city,'NULL')&lt;&gt;nvl(:old.city,'NULL') then
  select osuser,username,terminal
  into   v_osuser,v_username,v_terminal
  from v$session
  where audsid=userenv('SESSIONID');
  insert into 
  IT_TRG_CITY(customer_id,old,new,osuser,terminal,userid,chng_date) values(:old.customer_id,:old.subs_mask,:new.subs_mask,v_osuser,v_terminal,v_username,sysdate);
  end if;
  END;
  </code></pre>