title: Making a tricky mysql virtual column
body: <p>am trying to use mysql virtual columns feature to achieve a search mechanism where i have booking numbers may be a real integer like 101 or an alpha numeric as A101 , B101 etc.</p>
  <p>So i do need to make a search mechanism where the use will input 101 and i will fetch all bookings with 101 which certainly one booking but also i will fetch all those bookings with characters like A101 , B101 i hope you got the point.</p>
  <p>i used virtual columns with json and they were very effective like the following.</p>
  <pre><code>            DB::statement('ALTER TABLE finances ADD meta_type BIGINT AS (JSON_UNQUOTE(meta-&gt;&quot;$.type&quot;))');
  </code></pre>
  <p>and here am extracting the json value and assign it to my new virtual column</p>
  <p>now i need to make the same step but with another logic</p>
  <pre><code>  DB::statement('ALTER TABLE bookings ADD number_vc  BIGINT AS ( convert number column which is alpha numeric to integer only  )');
  </code></pre>
  <p>i want to get rid of all char in the number column value strip it all and leave only the integer to be assigned to my number_vc new column , so when my migration executed successfully i will end up with the following</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>number</th>
  <th>number_vc (the new virtual column)</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>101</td>
  <td>101</td>
  </tr>
  <tr>
  <td>2</td>
  <td>A101</td>
  <td>101</td>
  </tr>
  <tr>
  <td>3</td>
  <td>B101</td>
  <td>101</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>So am missing the As ( convert in my statement ) so any help would be appreciated !</p>