title: On Duplicate Key Update same as insert
body: <p>I've searched around but didn't find if it's possible.</p>
  
  <p>I've this MySQL query:</p>
  
  <pre><code>INSERT INTO table (id,a,b,c,d,e,f,g) VALUES (1,2,3,4,5,6,7,8)
  </code></pre>
  
  <p>Field id has a "unique index", so there can't be two of them. Now if the same id is already present in the database, I'd like to update it. But do I really have to specify all these field again, like:</p>
  
  <pre><code>INSERT INTO table (id,a,b,c,d,e,f,g) VALUES (1,2,3,4,5,6,7,8) 
  ON DUPLICATE KEY UPDATE a=2,b=3,c=4,d=5,e=6,f=7,g=8
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>INSERT INTO table (id,a,b,c,d,e,f,g) VALUES (1,2,3,4,5,6,7,8) 
  ON DUPLICATE KEY UPDATE a=VALUES(a),b=VALUES(b),c=VALUES(c),d=VALUES(d),e=VALUES(e),f=VALUES(f),g=VALUES(g)
  </code></pre>
  
  <p>I've specified everything already in the insert...</p>
  
  <p>A extra note, I'd like to use the work around to get the ID to!</p>
  
  <pre><code>id=LAST_INSERT_ID(id)
  </code></pre>
  
  <p>I hope somebody can tell me what the most efficient way is.</p>