title: How to random a zero leading string field mysql
body: <p>I'm not sure if you understand my question correctly. So may I explain a bit. I have a customer table which is needed to test with different number (no matter if it real). So this is the script:</p>
  
  <p><strong>customer_db</strong></p>
  
  <pre><code>+----+------------+
  | ID |   NUMBER   |
  +----+------------+
  | 1  | 0812345678 |
  +----+------------+
  | 2  | 0812345678 |
  +----+------------+
  | 3  | 0812345678 |
  +----+------------+
  .
  .
  .
  |100 | 0812345678 |
  </code></pre>
  
  <p>According to the table. I ran this script:</p>
  
  <pre><code>UPDATE customer_db SET number = FLOOR(0812345678 + rand()*1000000);
  </code></pre>
  
  <p>Doing this. I expect the field remains the same format with leading '081' and random the rest 6 digits. <strong>But it's not</strong>. The table becomes these :</p>
  
  <pre><code>+----+------------+
  | ID |   NUMBER   |
  +----+------------+
  | 1  | 812246797 |
  +----+------------+
  | 2  | 816548798 |
  +----+------------+
  | 3  | 815787898 |
  +----+------------+
  .
  .
  .
  |100 | 813454687 |
  </code></pre>
  
  <p>It 9 digits instead of 10. Because the leading '0' is missing. What should I do to remain the leading '0' after the random.</p>