'Write a query which will show all employees whose last names start with "M" and have an 'ae' anywhere in their last name

I tried to write it like this.

WHERE LastName LIKE 'M%'

but did not complete all



Solution 1:[1]

You'll want something like:

select LastName from people where LastName like "M%ae%"

Each % is a wild card for an unknown number of unknown letters.

(Replace people with the name of the relevant table, and the first occurrence of LastName with the information you want from the table)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1