Fetch value from JSON
If I recall, you need to use the json_ specific query functions to query within a tuple.

There is an example query on the JSONB module page demonstrating this. This module is not required, but does have an example of how to write a db_query:


  If you wanted to query for JSON records that were in the 2005-2006
  timeframe for high school graduates, you could do the following:


$results = db_query("SELECT point
      FROM (SELECT jsonb_array_elements(field_jsondata_value) point FROM {node__field_jsondata}) points
      WHERE point-&gt;'DataType' = :type
        AND point-&gt;'TimeFrame' = :frame
        AND point-&gt;'Education' = :education",
      array(':type' =&gt; '"Percent"', ':frame' =&gt; '"2005-2006"', ':education' =&gt; '"High school graduate"'));



  You would receive the fourth object only. The function
  jsonb_array_elements expands data at runtime to query data in this
  manner.


I don't think Drupal core supports the usage of these functions outright, maybe it does, but I accomplished this in both Drupal 7 and 8 with db_query.