title: generating unique CHAR(8) random values in an SQL statement
body: <p>I have this table:<br>
  <code>-id : primary key<br>
  -code : CHAR(8) unique</code>  </p>
  
  <p>Is there a way in ANSI SQL (or MySQL) of generating a unique numeric <em>code</em> ( <em>can</em>  be  based on the autonumeric <em>id</em> ) in a single SQL statement for any number of rows? (let's say 100)  </p>
  
  <p>I'm already doing this in a loop in PHP but wonder if it can be done in pure SQL.</p>