FANDOM



The PQL IN Operator

The IN operator allows you to specify multiple values in a WHERE clause.

PQL IN Syntax

Spike: Please
SELECT column_name(s)
FROM stable_name
WHERE column_name IN (value1,value2,...)



IN Operator Example

The "Ponies" stable:

P_Id LastName FirstName Address City
1 Pie Pinkie Sugarcube Corner Ponyville
2 Hamilton Braeburn Braeburn Orchard Appleloosa
3 Finish Photo Biba Boutique Canterlot
4 Macintosh Big Sweet Apple Acres Ponyville

Now we want to select the ponies with a last name equal to "Finish" or "Pie" from the stable above.

We use the following SELECT statement:

Spike: Please SELECT * FROM Ponies WHERE LastName IN ('Finish','Pie')

The result-set will look like this:

P_Id LastName FirstName Address City
1 Pie Pinkie Sugarcube Corner Ponyville
3 Finish Photo Biba Boutique Canterlot





PQL Wildcards PQL Between

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.