LIKE clause
Use the LIKE clause to retrieve partial string matches in the Ariel database.
You can search fields by using the LIKE clause.
The following table shows the wildcard options are supported by the Ariel Query Language (AQL).
| Wildcard character | Description |
|---|---|
| % | Matches a string of zero or more characters |
| _ | Matches any single character |
Examples of LIKE clauses
To match names such as Joe, Joanne, Joseph, or any other name that begins with Jo, type the following query:
SELECT * FROM events WHERE userName LIKE 'Jo%'
To match names that begin with Jo that are 3 characters long, such as, Joe or Jon, type the following query:
SELECT * FROM events WHERE userName LIKE 'Jo_'
You can enter the wildcard option at any point in the command, as shown in the following examples.
SELECT * FROM flows WHERE sourcePayload LIKE '%xyz'
SELECT * FROM events WHERE UTF8(payload) LIKE '%xyz%'
SELECT * FROM events WHERE UTF8(payload) LIKE '_yz'Examples of string matching keywords
The keywords, ILIKE and IMATCHES are case-insensitive versions of LIKE and
MATCHES.
SELECT qidname(qid) as test FROM events WHERE test LIKE 'Information%'
SELECT qidname(qid) as test FROM events WHERE test ILIKE 'inForMatiOn%'
SELECT qidname(qid) as test FROM events WHERE test MATCHES '.*Information.*'
SELECT qidname(qid) as test FROM events WHERE test IMATCHES '.*Information.*'