title: MySQL avoid duplicate entries in CurrentTimeStamp
body: <p>when i trying to insert large set of rows using <code>sql</code> query directly into database.</p>
  
  <pre><code>INSERT INTO `table1`(`id1`, `id2`, `id3`) 
  SELECT CURRENT_TIMESTAMP,id4, id5 FROM table2
  </code></pre>
  
  <blockquote>
    <p>Duplicate entry '2015-02-03 20:49:59' for key 'PRIMARY'</p>
  </blockquote>
  
  <p>It is because two rows trying add same time-stamp as their primary key. In java we can check uniqueness through maintaining a variable. How to ensure this uniqueness while directly inserting in mysql database</p>