title: How to reset autoincrement value in mysql?
body: <p>My company has different type of invoices.
  Example:</p>
  
  <p>H00001/2013
  .
  .
  .
  H99999/2013</p>
  
  <p>and</p>
  
  <p>T00001/2013
  .
  .
  .
  T99999/2013</p>
  
  <p>The problem is, the numbering is increasing for new year.
  How can I make auto increment value reset for each new year?</p>
  
  <p>This is my current code:</p>
  
  <pre><code>    CREATE TABLE `invoices` ( 
        `invoicenumber` mediumint unsigned NOT NULL auto_increment, 
        `invoicetype` enum('A','B') NOT NULL, 
        `date` date NOT NULL, 
        `client` varchar(100) NOT NULL,
        PRIMARY KEY (invoicetype,invoicenumber)
      ) COMMENT='' ENGINE='MyISAM'; 
  </code></pre>