PQL Wildcards

The PQL Wildcards
PQL wildcards can be used when searching for data in a database. PQL wildcards can substitute for one or more characters when searching for data in a database. PQL wildcards must be used with the PQL LIKE operator.

With PQL, the following wildcards can be used:

PQL Wildcard Examples
We have the following "Ponies" stable:

Using the % Wildcard
Now we want to select the ponies living in a city that starts with "Ap" from the "Ponies" stable.

We use the following SELECT statement:

The result-set will look like this:

Next, we want to select the ponies living in a city that contains the pattern "vil" from the "Ponies" stable.

We use the following SELECT statement:

The result-set will look like this:

Using the _ Wildcard
Now we want to select the ponies with a first name that starts with any character, followed by "in" from the "Ponies" stable.

We use the following SELECT statement:

The result-set will look like this:

Next, we want to select the ponies with a last name that starts with "F", followed by any character, followed by "ni", followed by any character, followed by "h" from the "Ponies" stable.

We use the following SELECT statement:

The result-set will look like this:

Using the [charlist] Wildcard
Now we want to select the ponies with a last name that starts with "P" or "F" or "M" from the "Ponies" stable.

We use the following SELECT statement:

The result-set will look like this:

Next, we want to select the ponies with a last name that do not start with "P" or "F" or "M" from the "Ponies" stable.

We use the following SELECT statement:

The result-set will look like this: