STRING QBE Operator

Learn to use _string QBE operator to filter specific data from the car racing dataset through simple examples.

Analogous to the TO_CHAR operator in SQL, you can use the _string QBE operator to typecast the input to a char.

Example 3-18 _string Operator

SELECT JSON_SERIALIZE(data PRETTY) AS data FROM GRAPHQL('
    query {
        race (
            check: {
                date: {_string: {_like: "%MAR-24"}}
            }
        ){
            id: race_id
            name
            date: race_date
            podium
        }
    }
');

The preceding example would select all the races that happened in March 2024:

DATA
--------------------------------------------------------------------------------
{
  "id" : 201,
  "name" : "Bahrain Grand Prix",
  "date" : "2024-03-02T00:00:00",
  "podium" :
  {
    "winner" :
    {
      "name" : "Max Verstappen",
      "time" : "1:32:17"
    },
    "firstRunnerUp" :
    {
      "name" : "Sergio Pérez",
      "time" : "1:32:33"
    },
    "secondRunnerUp" :
    {
      "name" : "Charles Leclerc",
      "time" : "1:32:45"
    }
  }
}
...................................
...................................


3 rows selected.