title: Is there any way to get value from JSON format through mysql query or function/procedure?
body: <p>Is there any way to get value from JSON format which are stored in database field.</p>
  
  <p>I had tried like below but sometimes it return wrong value and it doesn't seems to correct thing to fetch records.
  Actually I am trying to addition of all sizes</p>
  
  <pre><code>    SELECT 
      substring_index(substr(size,locate('"xs":"',size)+char_length('"xs":"')),'"',1)+
       substring_index(substr(size,locate('"s":"',size)+char_length('"s":"')),'"',1)+ 
      substring_index(substr(size,locate('"m":"',size)+char_length('"m":"')),'"',1)+ 
      substring_index(substr(size,locate('"l":"',size)+char_length('"l":"')),'"',1)+ 
      substring_index(substr(size,locate('"xl":"',size)+char_length('"xl":"')),'"',1)+ 
      substring_index(substr(size,locate('"xxl":"',size)+char_length('"xxl":"')),'"',1)+ substring_index(substr(size,locate('"xxxl":"',size)+char_length('"xxxl":"')),'"',1)+ 
      substring_index(substr(size,locate('"xs\/s":"',size)+char_length('"xs\/s":"')),'"',1)+ substring_index(substr(size,locate('"m\\/l":"',size)+char_length('"m\\/l":"')),'"',1)+ 
  substring_index(substr(size,locate('"xl\\\/xxl":"',size)+char_length('"xl\\\/xxl":"')),'"',1) 
  
      as qty FROM `table_name` 
  </code></pre>
  
  <p>I have also taken the reference to catch numeric value from a string from below question of StackOverflow:
  <a href="https://stackoverflow.com/questions/978147/how-do-you-extract-a-numerical-value-from-a-string-in-a-mysql-query">How do you extract a numerical value from a string in a MySQL query?</a></p>
  
  <p>it returns correct value and i can do addition addition of return value,,but for 2 digit number it is not good for me (like if it return 15 so it is 6 for my case)</p>