title: extract string from string in mysql query
body: <p>I have this query:-</p>
  
  <pre><code> select col_str,
   getVal,another_str,resultVal_str from tablename
  </code></pre>
  
  <p>Getting results like this:</p>
  
  <pre><code> col_str                                        getVal   another_str              
  '11,12,33,54,1,44'                              '12'    '9,5,4,8,7'               
  '11,12,33,54,1,44,10,12,11,12,12'               '44'    '9,5,4,8,7,6,3,5,2,4,2'   
  '11,12,33,54,1,44'                              '999'   '9,5,4,8,7,4'             
  '11,12,33'                                      '0'     '9,5,4'                   
  -----                                           ----      -----                   
  -----                                           ----      -----                   
  -----                                           ----      -----   
  </code></pre>
  
  <p>The columns <code>col_str,getVal,another_str</code> came from table and the column <code>resultVal_str</code> want to calculate based on remaining three column, 
  Logic for <code>resultVal_str</code> - </p>
  
  <p>See first record <code>getVal</code> having value 12 and <code>col_str</code> having 12 at location number 2 then see the location number two in <code>another_str</code> is 5, so the <code>resultVal_str</code> is 5 and so on. See below:</p>
  
  <pre><code>col_str                                        getVal   another_str               resultVal_str
  '11,12,33,54,1,44'                              '12'    '9,5,4,8,7'                  5
  '11,12,33,54,1,44,10,12,11,12,12'               '44'    '9,5,4,8,7,6,3,5,2,4,2'      6
  '11,12,33,54,1,44'                              '999'   '9,5,4,8,7,4'                0
  '11,12,33'                                      '0'     '9,5,4'                      0
  -----                                           ----      -----                     ---
  -----                                           ----      -----                     ---
  -----                                           ----      -----                     ---
  </code></pre>
  
  <p>How can i add the next column <code>resultVal_str</code> with getting result like above ?</p>