Help for this page

Select Code to Download


  1. or download this
    -- 1. remove rows in T2 that are not in T1
    delete T2
    where not exists (
    ...
        select 1 from T2
        where T1.Ka = T2.Ka and T1.Kb = T2.Kb and ...
    )
    
  2. or download this
    1.  Pull one row from each result set.
    LOOP:
    2.  Compare T1 keys to T2 keys
    ...
    5.  Compare T1 and T2 values
    6.  If different, generate an "update" statement
    7.  "Advance" both T1 and T2, return to loop