Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Ethan Martin
PLUS
Ethan Martin
Courses Plus Student 1,883 Points

-- Remove actors with the first name "Yuri", "Walter" and "Victor".

-- Remove actors with the first name "Yuri", "Walter" and "Victor".

DELETE FROM actors WHERE name IN LIKE ("Yuri%", "Walter%" , "Victor%");

Is there anything that allows me to combine the IN and LIKE function?

I know this question has been asked in other forms before but I feel like there should be a way to create a list like this.

2 Answers

Gabriel Plackey
Gabriel Plackey
11,064 Points

No sadly, IN LIKE is not a thing. You have to do,

DELETE FROM actors where name like 'Yuri%' OR name LIKE 'Walter%' OR name LIKE 'Victor%'

Or you could use WHERE CONTAINS but I don't see that that often

Don't forget to put a space between the name and the wildcard, ('Victor %') or you will end up deleting Victoria as well.