How do I use the contain function in AWS Athena to find certain text

Viewed 4710

I have a simple table let's say Names. In the column First I want to find all rows that contain the letters Jo. It would then result in Joe and John.

However when I try and use contains function it talks about an array and I have no idea how to get it to work.

Thanks.

1 Answers

CONTAINS() is a function that checks if an elements is in an array.

You can use the LIKE operator (which is Standard SQL). If you want names that start with "Jo":

where name like 'Jo%'

If you want to match names with "Jo" anywhere:

where name like '%Jo%'
Related