LENGTH QBE Operator

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

Analogous to the LENGTH operator in SQL, you can use the _length QBE operator to obtain the length of the input

Example 3-19 _length Operator

SELECT JSON_SERIALIZE(data PRETTY) AS data FROM GRAPHQL('
    query {
        driver (
            check: {
                name: {_length: {_gte: 16}}
            }
        ){
            id: driver_id
            name
            points
        }
    }
');

In this example, you check and return the details of the drivers whose name is longer than 16 characters:

DATA
--------------------------------------------------------------------------------
{
  "id" : 104,
  "name" : "Carlos Sainz Jr.",
  "points" : 340
}

{
  "id" : 113,
  "name" : "Nico Hülkenberg",
  "points" : 30
}

{
  "id" : 115,
  "name" : "Daniel Ricciardo",
  "points" : 24
}


3 rows selected.