title: SQL Double Query Injection
body: <p>I have the following query with me </p>
  
  <pre><code>select 
      count(*),
      concat((select database()), floor(rand() * 2)) as x        
  from users 
  group by x;
  </code></pre>
  
  <p>As I run this query in the MYSQL client over and over, I get 2 different responses. Sometimes, I end up with this error(which I expect as per the blog I am reading)</p>
  
  <pre><code>ERROR 1062 (23000): Duplicate entry 'mobile10' for key 'group_key'
  </code></pre>
  
  <p>At other times, I get a result like :</p>
  
  <pre><code>+----------+------------------+
  | count(*) | x                |
  +----------+------------------+
  |     6444 | mobile_app_dev10 |
  |     6505 | mobile_app_dev11 |
  +----------+------------------+
  </code></pre>
  
  <ol>
  <li>Why do I see 2 different results?</li>
  <li>What exactly does the error in the first response mean?</li>
  </ol>