title: MySQL - Extracting numbers out of strings
body: <p>In a MySQL database, I have a table which contains itemID, itemName and some other fields.</p>
  
  <p>Sample records (respectively itemID and itemName):</p>
  
  <blockquote>
    <p>vaX652bp_X987_foobar, FooBarItem <br/>
    X34_bar, BarItem <br/>
    tooX56, TOOX_What</p>
  </blockquote>
  
  <p>I want to write a query which gives me an output like:</p>
  
  <p>652, FooBarItem <br/>
  34, BarItem <br/>
  56, TOOX_What</p>
  
  <p>In other words, I want to extract out the number from the itemID column. But the condition is that the extracted number should be the number that occurs after the first occurence of the character "X" in the itemID column. </p>
  
  <p>I am currently trying out locate() and substring() but could not (yet) achieve what I want..</p>
  
  <p><strike>
  <strong>EDIT:</strong>
  Unrelated to the question - Can any one see all the answers (currently two) to this question ? I see only the first answer by "soulmerge". Any ideas why ? And the million dollar question - Did I just find a bug ?!
  </strike></p>