Using the LIKE operator and wildcards

List of functions

In DPQL  you can use the LIKE operator in the WHERE clause to check for certain patterns.

You would use it alongside wildcards:

%  represents any number of characters

_  represents one character


Tickets from a single email domain

An example of this you could use would be if you wanted to look at all tickets from users under a specific email domain.

The query below wouldn't work as the email address is incomplete:

FROM tickets
WHERE = ''

However if rather than = we use Like and the % wildcard we can pull all emails that end in

FROM tickets

Tickets from similar email domains

Similarly if we wanted to pull all tickets submitted from and we could use the following as the second % would bypass the characters specified after deskpro:

FROM tickets
WHERE LIKE '%deskpro%'

Wildcard Variations

You can play around with the way you use wildcards to return values in different scenarios.

Below are some wildcard variations that return :

WHERE LIKE Description
WHERE LIKE 'Support%' Any values that begin with support
WHERE LIKE '' Any values  that end with
WHERE LIKE '%Deskpro%' Any values that contain Deskpro
WHERE LIKE 's%m' Any value that starts with S and ends with M
WHERE LIKE '_u%' Any value that has a U at the second position

Published: 25/06/2019

Last updated: 26/07/2019