title: Generate value not in mysql table
body: <p>I have used following query that use to generate random value not in mysql table.</p>
  
  <pre><code>SELECT FLOOR( RAND()*1000 + 50 ) AS temp FROM tempcode WHERE  'temp' NOT IN ( SELECT code FROM tempcode ) LIMIT 1
  </code></pre>
  
  <p>but when I reduce the value to RAND()*4 for checking purpose using dummy data that not functioning well. </p>
  
  <pre><code>SELECT FLOOR( RAND()*1000 + 50 ) AS temp FROM tempcode WHERE  'temp' NOT IN ( SELECT code FROM tempcode ) LIMIT 1
  </code></pre>
  
  <p>What would be the reason? Any suggestions to generate value not in mysql table? </p>