title: My oracle merge does not work
body: <p>I am running 
  Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Prod.
  I want to merge data from m2 into m1. I expect to see 3 records
  in m1 after the merge, one for 'c' with a knt of 4, one for 'a' with a knt of 1
  and one for 'b' with a knt of 1. </p>
  
  <p>But I get everything. As if no checking for update or insert occurred. </p>
  
  <p>See below. </p>
  
  <p>Best regards,</p>
  
  <p>Phil</p>
  
  <pre><code> SQL&gt; desc m1;
   Name                                      Null?    Type
   ----------------------------------------- -------- ----------------------------
   K                                                  VARCHAR2(6)
   V                                                  VARCHAR2(6)
   KNT                                                NUMBER(4)
  
  SQL&gt; desc m2;
   Name                                      Null?    Type
   ----------------------------------------- -------- ----------------------------
   K                                                  VARCHAR2(6)
   V                                                  VARCHAR2(6)
   KNT                                                NUMBER(4)
  
  SQL&gt; select * from m1;
  
  no rows selected
  
  SQL&gt; select * from m2;
  
  K      V             KNT
  ------ ------ ----------
  a      aaa             0
  b      bbb             0
  c      ccc             0
  c      ccc             0
  c      ccc             0
  a      aaa             0
  b      bbb             0
  c      ccc             0
  c      ccc             0
  
  
  SQL&gt; merge into m1 d
    2  using (select k,v,knt from m2) s
  
   SQL&gt; desc m1;
   Name                                      Null?    Type
   ----------------------------------------- -------- ----------------------------
   K                                                  VARCHAR2(6)
   V                                                  VARCHAR2(6)
   KNT                                                NUMBER(4)
  
  SQL&gt; desc m2;
   Name                                      Null?    Type
   ----------------------------------------- -------- ----------------------------
   K                                                  VARCHAR2(6)
   V                                                  VARCHAR2(6)
   KNT                                                NUMBER(4)
  
  SQL&gt; select * from m1;
  
  no rows selected
  
  SQL&gt; select * from m2;
  
  K      V             KNT
  ------ ------ ----------
  a      aaa             0
  b      bbb             0
  c      ccc             0
  c      ccc             0
  c      ccc             0
  a      aaa             0
  b      bbb             0
  c      ccc             0
  c      ccc             0
  
  
  SQL&gt; merge into m1 d
    2  using (select k,v,knt from m2) s
    3  on (d.k = s.k)
    4  when matched then
    5  update set d.knt = d.knt+1
    6  when not matched then
    7  insert(d.k,d.v,d.knt)
    8  values(s.k,s.v,s.knt)
    9  ;
  
  SQL&gt; select * from m1;
  
  K      V             KNT
  ------ ------ ----------
  b      bbb             0
  b      bbb             0
  c      ccc             0
  c      ccc             0
  c      ccc             0
  c      ccc             0
  c      ccc             0
  a      aaa             0
  a      aaa             0
  </code></pre>