LIKE and NOT LIKE QBE Operators
Learn to use the _like and _nlike QBE operators to filter specific data from the car racing dataset through simple examples.
Example 3-12 _like Operator
SELECT JSON_SERIALIZE(data PRETTY) AS data FROM GRAPHQL('
query {
team (
check: {
name: {_like: "%Honda%"}
}
) {
id: team_id
name
points
}
}
');
The preceding example would fetch the id, name, and points information from the team table where the field name contains the string Honda:
DATA
--------------------------------------------------------------------------------
{
"id" : 303,
"name" : "Red Bull Racing Honda RBPT",
"points" : 589
}
{
"id" : 308,
"name" : "RB Honda RBPT",
"points" : 46
}
2 rows selected.
On the other hand, if you want your output to exclude information from the team table where the field name contains the string Honda you can use the _nlike QBE operator to specify this condition.