Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
See the whole table
Select some columns
Filtering rows
Logic
Text patterns
16. The percentage sign (%) continued
To be or NULL to be
A little bit of mathematics
Let's practice

Instruction

That's the way to go! Of course, the percentage sign (%) can be put anywhere between the single quotes and as many times as it's necessary:

SELECT *
FROM user
WHERE name LIKE '%A%';

That's right, the example above will select any user whose name contains at least one 'A'.

Remember that the percentage sign (%) can also match zero characters, so the name can also begin or end with the A.

Exercise

Select the vin columns for all cars whose model ends with an "s".

Stuck? Here's a hint!

Type:

SELECT vin
FROM car
WHERE model LIKE '%s';