title: Insert and set value with max()+1 problems
body: <p>I am trying to insert a new row and set the customer_id with max()+1. The reason for this is the table already has a auto_increatment on another column named id and the table will have multiple rows with the same customer_id.</p>
  
  <p>With this:</p>
  
  <pre><code>INSERT INTO customers
    ( customer_id, firstname, surname )
  VALUES 
    ((SELECT MAX( customer_id ) FROM customers) +1, 'jim', 'sock')
  </code></pre>
  
  <p>...I keep getting the following error:</p>
  
  <pre><code>#1093 - You can't specify target table 'customers' for update in FROM clause
  </code></pre>
  
  <p>Also how would I stop 2 different customers being added at the same time and not having the same customer_id?</p>